summaryrefslogtreecommitdiff
path: root/test/test.sh
blob: 60e3e2640fc927f51d31539a3f830c28a3c488d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

set -eu

cd "$(dirname "$0")"

run_tests() {
	for file in $(find .. -type f -size -32760c); do
		if ! ./deflate $file | ./inflate > tmp; then
			echo "inflate error at $file"
			./deflate $file | ./inflate > tmp
		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

rm -f tmp