mirror of
https://github.com/google/brotli.git
synced 2025-01-03 21:51:07 +00:00
Merge pull request #103 from szabadka/master
Handle multiple compressed files per original in the test.
This commit is contained in:
commit
4e94277e9d
@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
import glob
|
||||
import string
|
||||
import sys
|
||||
import os
|
||||
from subprocess import check_call
|
||||
@ -7,32 +9,12 @@ from subprocess import check_call
|
||||
from test_utils import PYTHON, BRO, TEST_ENV, diff_q
|
||||
|
||||
|
||||
INPUTS = """\
|
||||
testdata/empty.compressed
|
||||
testdata/x.compressed
|
||||
testdata/64x.compressed
|
||||
testdata/10x10y.compressed
|
||||
testdata/xyzzy.compressed
|
||||
testdata/quickfox.compressed
|
||||
testdata/ukkonooa.compressed
|
||||
testdata/monkey.compressed
|
||||
testdata/backward65536.compressed
|
||||
testdata/zeros.compressed
|
||||
testdata/quickfox_repeated.compressed
|
||||
testdata/compressed_file.compressed
|
||||
testdata/compressed_repeated.compressed
|
||||
testdata/alice29.txt.compressed
|
||||
testdata/asyoulik.txt.compressed
|
||||
testdata/lcet10.txt.compressed
|
||||
testdata/plrabn12.txt.compressed
|
||||
"""
|
||||
|
||||
os.chdir(os.path.abspath("../../tests"))
|
||||
for filename in INPUTS.splitlines():
|
||||
for filename in glob.glob("testdata/*.compressed*"):
|
||||
filename = os.path.abspath(filename)
|
||||
print('Testing decompression of file "%s"' % os.path.basename(filename))
|
||||
uncompressed = os.path.splitext(filename)[0] + ".uncompressed"
|
||||
expected = os.path.splitext(filename)[0]
|
||||
expected = string.split(filename, ".compressed")[0]
|
||||
uncompressed = expected + ".uncompressed"
|
||||
check_call([PYTHON, BRO, "-f", "-d", "-i", filename, "-o", uncompressed],
|
||||
env=TEST_ENV)
|
||||
if diff_q(uncompressed, expected) != 0:
|
||||
@ -43,3 +25,4 @@ for filename in INPUTS.splitlines():
|
||||
env=TEST_ENV)
|
||||
if diff_q(uncompressed, expected) != 0:
|
||||
sys.exit(1)
|
||||
os.unlink(uncompressed)
|
||||
|
@ -6,34 +6,16 @@
|
||||
set -o errexit
|
||||
|
||||
BRO=../tools/bro
|
||||
INPUTS="""
|
||||
testdata/empty.compressed
|
||||
testdata/x.compressed
|
||||
testdata/64x.compressed
|
||||
testdata/10x10y.compressed
|
||||
testdata/xyzzy.compressed
|
||||
testdata/quickfox.compressed
|
||||
testdata/ukkonooa.compressed
|
||||
testdata/monkey.compressed
|
||||
testdata/backward65536.compressed
|
||||
testdata/zeros.compressed
|
||||
testdata/quickfox_repeated.compressed
|
||||
testdata/compressed_file.compressed
|
||||
testdata/compressed_repeated.compressed
|
||||
testdata/alice29.txt.compressed
|
||||
testdata/asyoulik.txt.compressed
|
||||
testdata/lcet10.txt.compressed
|
||||
testdata/plrabn12.txt.compressed
|
||||
"""
|
||||
|
||||
for file in $INPUTS; do
|
||||
for file in testdata/*.compressed*; do
|
||||
echo "Testing decompression of file $file"
|
||||
uncompressed=${file%.compressed}.uncompressed
|
||||
expected=${file%.compressed}
|
||||
expected=${file%.compressed*}
|
||||
uncompressed=${expected}.uncompressed
|
||||
$BRO -f -d -i $file -o $uncompressed
|
||||
diff -q $uncompressed $expected
|
||||
# Test the streaming version
|
||||
cat $file | $BRO -d > $uncompressed
|
||||
diff -q $uncompressed $expected
|
||||
rm -f $uncompressed
|
||||
done
|
||||
|
||||
|
BIN
tests/testdata/empty.compressed.00
vendored
Normal file
BIN
tests/testdata/empty.compressed.00
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.01
vendored
Normal file
BIN
tests/testdata/empty.compressed.01
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.02
vendored
Normal file
BIN
tests/testdata/empty.compressed.02
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.03
vendored
Normal file
BIN
tests/testdata/empty.compressed.03
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.04
vendored
Normal file
BIN
tests/testdata/empty.compressed.04
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.05
vendored
Normal file
BIN
tests/testdata/empty.compressed.05
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.06
vendored
Normal file
BIN
tests/testdata/empty.compressed.06
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.07
vendored
Normal file
BIN
tests/testdata/empty.compressed.07
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.08
vendored
Normal file
BIN
tests/testdata/empty.compressed.08
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.09
vendored
Normal file
BIN
tests/testdata/empty.compressed.09
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.10
vendored
Normal file
BIN
tests/testdata/empty.compressed.10
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.11
vendored
Normal file
BIN
tests/testdata/empty.compressed.11
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.12
vendored
Normal file
BIN
tests/testdata/empty.compressed.12
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.13
vendored
Normal file
BIN
tests/testdata/empty.compressed.13
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.14
vendored
Normal file
BIN
tests/testdata/empty.compressed.14
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.15
vendored
Normal file
BIN
tests/testdata/empty.compressed.15
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.16
vendored
Normal file
BIN
tests/testdata/empty.compressed.16
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.17
vendored
Normal file
BIN
tests/testdata/empty.compressed.17
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/empty.compressed.18
vendored
Normal file
BIN
tests/testdata/empty.compressed.18
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/mapsdatazrh
vendored
Normal file
BIN
tests/testdata/mapsdatazrh
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/mapsdatazrh.compressed
vendored
Normal file
BIN
tests/testdata/mapsdatazrh.compressed
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/random_org_10k.bin
vendored
Normal file
BIN
tests/testdata/random_org_10k.bin
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/random_org_10k.bin.compressed
vendored
Normal file
BIN
tests/testdata/random_org_10k.bin.compressed
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/x.compressed.00
vendored
Normal file
BIN
tests/testdata/x.compressed.00
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/x.compressed.01
vendored
Normal file
BIN
tests/testdata/x.compressed.01
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/x.compressed.02
vendored
Normal file
BIN
tests/testdata/x.compressed.02
vendored
Normal file
Binary file not shown.
BIN
tests/testdata/x.compressed.03
vendored
Normal file
BIN
tests/testdata/x.compressed.03
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user