Fix build files (#829)

This commit is contained in:
Eugene Kliuchnikov 2020-08-26 17:13:31 +02:00 committed by GitHub
parent 665e81dc9b
commit d052918255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 23 deletions

13
.gitattributes vendored
View File

@ -24,8 +24,19 @@ WORKSPACE !export-ignore
# Add sources
c !export-ignore
c/** !export-ignore
c/common/dictionary.bin* export-ignore
c/common/dictionary.bin* export-ignore
c/fuzz export-ignore
scripts !export-ignore
scripts/sources.lst !export-ignore
scripts/libbrotli*.pc.in !export-ignore
tests !export-ignore
tests/*.sh !export-ignore
tests/*.cmake !export-ignore
tests/testdata !export-ignore
tests/testdata/empty !export-ignore
tests/testdata/empty.compressed !export-ignore
tests/testdata/ukkonooa !export-ignore
tests/testdata/ukkonooa.compressed !export-ignore
# Add man pages
docs !export-ignore

View File

@ -303,17 +303,21 @@ if(NOT BROTLI_DISABLE_TESTS)
set(OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}")
set(INPUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${INPUT}")
foreach(quality 1 6 9 11)
add_test(NAME "${BROTLI_TEST_PREFIX}roundtrip/${INPUT}/${quality}"
COMMAND "${CMAKE_COMMAND}"
-DBROTLI_WRAPPER=${BROTLI_WRAPPER}
-DBROTLI_WRAPPER_LD_PREFIX=${BROTLI_WRAPPER_LD_PREFIX}
-DBROTLI_CLI=$<TARGET_FILE:brotli>
-DQUALITY=${quality}
-DINPUT=${INPUT_FILE}
-DOUTPUT=${OUTPUT_FILE}.${quality}
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/run-roundtrip-test.cmake)
endforeach()
if (EXISTS "${INPUT_FILE}")
foreach(quality 1 6 9 11)
add_test(NAME "${BROTLI_TEST_PREFIX}roundtrip/${INPUT}/${quality}"
COMMAND "${CMAKE_COMMAND}"
-DBROTLI_WRAPPER=${BROTLI_WRAPPER}
-DBROTLI_WRAPPER_LD_PREFIX=${BROTLI_WRAPPER_LD_PREFIX}
-DBROTLI_CLI=$<TARGET_FILE:brotli>
-DQUALITY=${quality}
-DINPUT=${INPUT_FILE}
-DOUTPUT=${OUTPUT_FILE}.${quality}
-P ${CMAKE_CURRENT_SOURCE_DIR}/tests/run-roundtrip-test.cmake)
endforeach()
else()
message(WARNING "Test file ${INPUT} does not exist.")
endif()
endforeach()
file(GLOB_RECURSE

View File

@ -1,5 +1,9 @@
# !/bin/sh -e
if [ `uname -s` = "Darwin" ]; then
echo "WARNING: OSX autogen build is not supported"
fi
REQUIRED='is required, but not installed.'
bc -v >/dev/null 2>&1 || { echo >&2 "'bc' $REQUIRED"; exit 1; }
if [ `uname -s` != "FreeBSD" ]; then

View File

@ -20,15 +20,17 @@ c/dec/decode.c
"""
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
if [ -f $file ]; then
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
fi
done