mirror of
https://github.com/google/brotli.git
synced 2024-11-25 21:10:05 +00:00
03739d2b11
Update: * new CLI; bro -> brotli; + man page * JNI wrappers preparation (for bazel build) * add raw binary dictionary representation `dictionary.bin` * add ability to side-load brotli RFC dictionary * decoder persists last error now * fix `BrotliDecoderDecompress` documentation * go reader don't block until necessary * more consistent bazel target names * Java dictionary data compiled footprint reduced * Java tests refactoring
33 lines
768 B
Bash
Executable File
33 lines
768 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Roundtrip test for the brotli command-line tool.
|
|
|
|
set -o errexit
|
|
|
|
BROTLI=bin/brotli
|
|
TMP_DIR=bin/tmp
|
|
INPUTS="""
|
|
tests/testdata/alice29.txt
|
|
tests/testdata/asyoulik.txt
|
|
tests/testdata/lcet10.txt
|
|
tests/testdata/plrabn12.txt
|
|
c/enc/encode.c
|
|
c/common/dictionary.h
|
|
c/dec/decode.c
|
|
$BROTLI
|
|
"""
|
|
|
|
for file in $INPUTS; do
|
|
for quality in 1 6 9 11; do
|
|
echo "Roundtrip testing $file at quality $quality"
|
|
compressed=${TMP_DIR}/${file##*/}.br
|
|
uncompressed=${TMP_DIR}/${file##*/}.unbr
|
|
$BROTLI -fq $quality $file -o $compressed
|
|
$BROTLI $compressed -fdo $uncompressed
|
|
diff -q $file $uncompressed
|
|
# Test the streaming version
|
|
cat $file | $BROTLI -cq $quality | $BROTLI -cd >$uncompressed
|
|
diff -q $file $uncompressed
|
|
done
|
|
done
|