diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/compile-c++11.sh | 2 | ||||
-rwxr-xr-x | test/compile-c++20.sh | 2 | ||||
-rwxr-xr-x | test/compile-c11.sh | 2 | ||||
-rwxr-xr-x | test/compile-c99.sh | 2 | ||||
-rwxr-xr-x | test/test.sh | 20 |
5 files changed, 20 insertions, 8 deletions
diff --git a/test/compile-c++11.sh b/test/compile-c++11.sh index cb13625..b3305a5 100755 --- a/test/compile-c++11.sh +++ b/test/compile-c++11.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec g++ -std=c++11 -Wall -Wextra -pedantic -I../src -o inflate inflate-app.c ../src/inflate.c +exec g++ -std=c++11 -O2 -Wall -Wextra -pedantic -I../src "$@" -o inflate inflate-app.c ../src/inflate.c diff --git a/test/compile-c++20.sh b/test/compile-c++20.sh index 502063b..aa9f02a 100755 --- a/test/compile-c++20.sh +++ b/test/compile-c++20.sh @@ -1,4 +1,4 @@ #!/bin/sh # g++ as provided by Debian Buster (used for CI tests) does not support c++20 -exec g++ -std=c++2a -Wall -Wextra -pedantic -I../src -o inflate inflate-app.c ../src/inflate.c +exec g++ -std=c++2a -O2 -Wall -Wextra -pedantic -I../src "$@" -o inflate inflate-app.c ../src/inflate.c diff --git a/test/compile-c11.sh b/test/compile-c11.sh index 87ec632..c9ba1c4 100755 --- a/test/compile-c11.sh +++ b/test/compile-c11.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec gcc -std=c11 -Wall -Wextra -pedantic -I../src -o inflate inflate-app.c ../src/inflate.c +exec gcc -std=c11 -O2 -Wall -Wextra -pedantic -I../src "$@" -o inflate inflate-app.c ../src/inflate.c diff --git a/test/compile-c99.sh b/test/compile-c99.sh index 4583ebf..c13617d 100755 --- a/test/compile-c99.sh +++ b/test/compile-c99.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec gcc -std=c99 -Wall -Wextra -pedantic -I../src -o inflate inflate-app.c ../src/inflate.c +exec gcc -std=c99 -O2 -Wall -Wextra -pedantic -I../src "$@" -o inflate inflate-app.c ../src/inflate.c diff --git a/test/test.sh b/test/test.sh index 44104d5..60e3e26 100755 --- a/test/test.sh +++ b/test/test.sh @@ -4,10 +4,7 @@ set -eu cd "$(dirname "$0")" -for std in c++11 c++20 c99 c11; do - - "./compile-${std}.sh" - +run_tests() { for file in $(find .. -type f -size -32760c); do if ! ./deflate $file | ./inflate > tmp; then echo "inflate error at $file" @@ -15,6 +12,21 @@ for std in c++11 c++20 c99 c11; do fi diff $file tmp done +} + +for std in c++11 c++20 c99 c11; do + + "./compile-${std}.sh" + run_tests + + "./compile-${std}.sh" -DDEFLATE_CHECKSUM + run_tests + + "./compile-${std}.sh" -DDEFLATE_WITH_LUT + run_tests + + "./compile-${std}.sh" -DDEFLATE_CHECKSUM -DDEFLATE_WITH_LUT + run_tests done |