Commit f6f3326c authored by Dylan Baker's avatar Dylan Baker

Move tests into a tests/ directory

I've updated autotools, meson, and the makefile.msc, though I haven't
verified tat the nmake file works.
parent 73690241
......@@ -71,20 +71,21 @@ uninstall-hook:
rm -f $(DESTDIR)$(mandir)/man1/`echo "bzcmp" | sed 's,^.*/,,;$(transform)'`.1
check-local: bzip2
@cat $(srcdir)/words1
./bzip2 -1 <$(srcdir)/sample1.ref >sample1.rb2
./bzip2 -2 <$(srcdir)/sample2.ref >sample2.rb2
./bzip2 -3 <$(srcdir)/sample3.ref >sample3.rb2
./bzip2 -d <$(srcdir)/sample1.bz2 >sample1.tst
./bzip2 -d <$(srcdir)/sample2.bz2 >sample2.tst
./bzip2 -ds <$(srcdir)/sample3.bz2 >sample3.tst
cmp $(srcdir)/sample1.bz2 sample1.rb2
cmp $(srcdir)/sample2.bz2 sample2.rb2
cmp $(srcdir)/sample3.bz2 sample3.rb2
cmp sample1.tst $(srcdir)/sample1.ref
cmp sample2.tst $(srcdir)/sample2.ref
cmp sample3.tst $(srcdir)/sample3.ref
@cat $(srcdir)/words3
@cat $(top_srcdir)/tests/words1
@mkdir $(top_builddir)/tests/
./bzip2 -1 <$(top_srcdir)/tests/sample1.ref >$(top_builddir)/tests/sample1.rb2
./bzip2 -2 <$(top_srcdir)/tests/sample2.ref >$(top_builddir)/tests/sample2.rb2
./bzip2 -3 <$(top_srcdir)/tests/sample3.ref >$(top_builddir)/tests/sample3.rb2
./bzip2 -d <$(top_srcdir)/tests/sample1.bz2 >$(top_builddir)/tests/sample1.tst
./bzip2 -d <$(top_srcdir)/tests/sample2.bz2 >$(top_builddir)/tests/sample2.tst
./bzip2 -ds <$(top_srcdir)/tests/sample3.bz2 >$(top_builddir)/tests/sample3.tst
cmp $(top_srcdir)/tests/sample1.bz2 $(top_builddir)/tests/sample1.rb2
cmp $(top_srcdir)/tests/sample2.bz2 $(top_builddir)/tests/sample2.rb2
cmp $(top_srcdir)/tests/sample3.bz2 $(top_builddir)/tests/sample3.rb2
cmp $(top_builddir)/tests/sample1.tst $(top_srcdir)/tests/sample1.ref
cmp $(top_builddir)/tests/sample2.tst $(top_srcdir)/tests/sample2.ref
cmp $(top_builddir)/tests/sample3.tst $(top_srcdir)/tests/sample3.ref
@cat $(top_srcdir)/tests/words3
manual: $(srcdir)/manual.html $(srcdir)/manual.ps $(srcdir)/manual.pdf
......@@ -100,8 +101,8 @@ manual.html: $(MANUAL_SRCS)
EXTRA_DIST = \
$(bin_SCRIPTS) \
$(man_MANS) \
README.autotools \
README.XML.STUFF \
README.autotools \
bz-common.xsl \
bz-fo.xsl \
bz-html.xsl \
......@@ -123,16 +124,17 @@ EXTRA_DIST = \
meson.build \
meson_options.txt \
mk251.c \
sample1.bz2 \
sample1.ref \
sample2.bz2 \
sample2.ref \
sample3.bz2 \
sample3.ref \
spewG.c \
tests/meson.build
tests/sample1.bz2 \
tests/sample1.ref \
tests/sample2.bz2 \
tests/sample2.ref \
tests/sample3.bz2 \
tests/sample3.ref \
tests/words0 \
tests/words1 \
tests/words2 \
tests/words3 \
unzcrash.c \
words0 \
words1 \
words2 \
words3 \
xmlproc.sh
......@@ -25,24 +25,24 @@ lib: $(OBJS)
test: bzip2
type words1
.\\bzip2 -1 < sample1.ref > sample1.rb2
.\\bzip2 -2 < sample2.ref > sample2.rb2
.\\bzip2 -3 < sample3.ref > sample3.rb2
.\\bzip2 -d < sample1.bz2 > sample1.tst
.\\bzip2 -d < sample2.bz2 > sample2.tst
.\\bzip2 -ds < sample3.bz2 > sample3.tst
.\\bzip2 -1 < tests\sample1.ref > sample1.rb2
.\\bzip2 -2 < tests\sample2.ref > sample2.rb2
.\\bzip2 -3 < tests\sample3.ref > sample3.rb2
.\\bzip2 -d < tests\sample1.bz2 > sample1.tst
.\\bzip2 -d < tests\sample2.bz2 > sample2.tst
.\\bzip2 -ds < tests\sample3.bz2 > sample3.tst
@echo All six of the fc's should find no differences.
@echo If fc finds an error on sample3.bz2, this could be
@echo because WinZip's 'TAR file smart CR/LF conversion'
@echo is too clever for its own good. Disable this option.
@echo The correct size for sample3.ref is 120,244. If it
@echo is 150,251, WinZip has messed it up.
fc sample1.bz2 sample1.rb2
fc sample2.bz2 sample2.rb2
fc sample3.bz2 sample3.rb2
fc sample1.tst sample1.ref
fc sample2.tst sample2.ref
fc sample3.tst sample3.ref
fc tests\sample1.bz2 sample1.rb2
fc tests\sample2.bz2 sample2.rb2
fc tests\sample3.bz2 sample3.rb2
fc tests\sample1.tst sample1.ref
fc tests\sample2.tst sample2.ref
fc tests\sample3.tst sample3.ref
......@@ -51,12 +51,12 @@ clean:
del libbz2.lib
del bzip2.exe
del bzip2recover.exe
del sample1.rb2
del sample2.rb2
del sample3.rb2
del sample1.tst
del sample2.tst
del sample3.tst
del tests\sample1.rb2
del tests\sample2.rb2
del tests\sample3.rb2
del tests\sample1.tst
del tests\sample2.tst
del tests\sample3.tst
.c.obj:
$(CC) $(CFLAGS) -c $*.c -o $*.obj
......
......@@ -104,26 +104,4 @@ if docs and prog_sh.found()
endforeach
endif
# Unit tests
prog_python = import('python').find_installation('python3')
# Tuple in the form (args, input, expected)
foreach t : [['-1', 'sample1.ref', 'sample1.bz2'],
['-2', 'sample2.ref', 'sample2.bz2'],
['-3', 'sample3.ref', 'sample3.bz2']]
test(
t[1],
prog_python,
args : [files('runtest.py'), '--mode', 'compress', bzip2, t[0], files(t[1]), files(t[2])],
)
endforeach
# Tuple in the form (args, input)
foreach t : [['-1', 'sample1.ref'],
['-2', 'sample2.ref'],
['-3', 'sample3.ref']]
test(
t[1],
prog_python,
args : [files('runtest.py'), '--mode', 'decompress', bzip2, t[0], files(t[1])],
)
endforeach
\ No newline at end of file
subdir('tests')
\ No newline at end of file
prog_python = import('python').find_installation('python3')
# Tuple in the form (args, input, expected)
foreach t : [['-1', 'sample1.ref', 'sample1.bz2'],
['-2', 'sample2.ref', 'sample2.bz2'],
['-3', 'sample3.ref', 'sample3.bz2']]
test(
t[1],
prog_python,
args : [files('runtest.py'), '--mode', 'compress', bzip2, t[0], files(t[1]), files(t[2])],
)
endforeach
# Tuple in the form (args, input)
foreach t : [['-1', 'sample1.ref'],
['-2', 'sample2.ref'],
['-3', 'sample3.ref']]
test(
t[1],
prog_python,
args : [files('runtest.py'), '--mode', 'decompress', bzip2, t[0], files(t[1])],
)
endforeach
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment