You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
672 B
26 lines
672 B
7 months ago
|
#!/usr/bin/env bash
|
||
|
#
|
||
|
# Test that the brotli command-line tool can decompress old brotli-compressed
|
||
|
# files.
|
||
|
#
|
||
|
# The first argument may be a wrapper for brotli, such as 'qemu-arm'.
|
||
|
|
||
|
set -o errexit
|
||
|
|
||
|
BROTLI_WRAPPER=$1
|
||
|
BROTLI="${BROTLI_WRAPPER} bin/brotli"
|
||
|
TMP_DIR=bin/tmp
|
||
|
|
||
|
for file in tests/testdata/*.compressed*; do
|
||
|
echo "Testing decompression of file $file"
|
||
|
expected=${file%.compressed*}
|
||
|
uncompressed=${TMP_DIR}/${expected##*/}.uncompressed
|
||
|
echo $uncompressed
|
||
|
$BROTLI $file -fdo $uncompressed
|
||
|
diff -q $uncompressed $expected
|
||
|
# Test the streaming version
|
||
|
cat $file | $BROTLI -dc > $uncompressed
|
||
|
diff -q $uncompressed $expected
|
||
|
rm -f $uncompressed
|
||
|
done
|