added cli test for decodecorpus inside tests/Makefile. Also changed calculation of offset

This commit is contained in:
Paul Cruz
2017-06-22 14:43:44 -07:00
parent 028fb9d01b
commit 829eb29033
2 changed files with 38 additions and 17 deletions
+30 -15
View File
@@ -342,21 +342,36 @@ test-decodecorpus: decodecorpus
test-decodecorpus-cli: decodecorpus
@echo "\n ---- decodecorpus basic cli tests ----"
mkdir tests
./decodecorpus -n5 -otests -ptests
cd testdir
zstd -d z000000.zst -D dictionary -o tmp0
zstd -d z000001.zst -D dictionary -o tmp1
zstd -d z000002.zst -D dictionary -o tmp2
zstd -d z000003.zst -D dictionary -o tmp3
zstd -d z000004.zst -D dictionary -o tmp4
diff z000000 tmp0
diff z000001 tmp1
diff z000002 tmp2
diff z000003 tmp3
diff z000004 tmp4
cd ..
rm -rf testdir
@mkdir testdir
./decodecorpus -n5 -otestdir -ptestdir
@cd testdir \
zstd -d z000000.zst -o tmp0 \
zstd -d z000001.zst -o tmp1 \
zstd -d z000002.zst -o tmp2 \
zstd -d z000003.zst -o tmp3 \
zstd -d z000004.zst -o tmp4 \
diff z000000 tmp0 \
diff z000001 tmp1 \
diff z000002 tmp2 \
diff z000003 tmp3 \
diff z000004 tmp4 \
@rm ./* \
@cd ..
./decodecorpus -n5 -otestdir -ptestdir --use-dict=1MB
@cd testdir \
zstd -d z000000.zst -D dictionary -o tmp0 \
zstd -d z000001.zst -D dictionary -o tmp1 \
zstd -d z000002.zst -D dictionary -o tmp2 \
zstd -d z000003.zst -D dictionary -o tmp3 \
zstd -d z000004.zst -D dictionary -o tmp4 \
diff z000000 tmp0 \
diff z000001 tmp1 \
diff z000002 tmp2 \
diff z000003 tmp3 \
diff z000004 tmp4 \
@cd ..
@rm -rf testdir
test-pool: pool
$(QEMU_SYS) ./pool