Skip to content

Commit b8f5bb2

Browse files
committed
Move verification out into separate script to fix ARM64 use
Some platforms don't have the clang sanitizer checks available that are used in the verification tests, currently on these the output files can't even be amalgamated. To fix this, separate amalgamation and verification so that the later can be skipped.
1 parent e570065 commit b8f5bb2

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

amalgamate.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,6 @@ OUTPUT_PREFIX=_build/amalgamation
88

99
cmake -H. -B_build -DAMALGAMATE_SOURCES=ON -G"Unix Makefiles"
1010

11-
echo "int main() { return 0; }" > main.c
12-
echo "Test compile with GCC..."
13-
gcc -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out
14-
echo "Test compile with GCC ANSI..."
15-
gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out
16-
if command -v clang
17-
then
18-
echo "Test compile with clang..."
19-
clang -Wall -Wpedantic -fsanitize=unsigned-integer-overflow -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out
20-
fi
21-
for def in MINIZ_NO_STDIO MINIZ_NO_TIME MINIZ_NO_DEFLATE_APIS MINIZ_NO_INFLATE_APIS MINIZ_NO_ARCHIVE_APIS MINIZ_NO_ARCHIVE_WRITING_APIS MINIZ_NO_ZLIB_APIS MINIZ_NO_ZLIB_COMPATIBLE_NAMES MINIZ_NO_MALLOC
22-
do
23-
echo "Test compile with GCC and define $def..."
24-
gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out -D${def}
25-
done
26-
echo "Test compile with GCC and MINIZ_USE_UNALIGNED_LOADS_AND_STORES=1..."
27-
gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out -DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=1
28-
rm test.out
29-
rm main.c
30-
3111
cp $OUTPUT_PREFIX/miniz.* amalgamation/
3212
cp ChangeLog.md amalgamation/
3313
cp LICENSE amalgamation/

amalgamate_and_verify.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
source ./amalgamate.sh
6+
7+
echo "int main() { return 0; }" > main.c
8+
echo "Test compile with GCC..."
9+
gcc -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out
10+
echo "Test compile with GCC ANSI..."
11+
gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out
12+
if command -v clang
13+
then
14+
echo "Test compile with clang..."
15+
clang -Wall -Wpedantic -fsanitize=unsigned-integer-overflow -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out
16+
fi
17+
for def in MINIZ_NO_STDIO MINIZ_NO_TIME MINIZ_NO_DEFLATE_APIS MINIZ_NO_INFLATE_APIS MINIZ_NO_ARCHIVE_APIS MINIZ_NO_ARCHIVE_WRITING_APIS MINIZ_NO_ZLIB_APIS MINIZ_NO_ZLIB_COMPATIBLE_NAMES MINIZ_NO_MALLOC
18+
do
19+
echo "Test compile with GCC and define $def..."
20+
gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out -D${def}
21+
done
22+
echo "Test compile with GCC and MINIZ_USE_UNALIGNED_LOADS_AND_STORES=1..."
23+
gcc -ansi -pedantic -Wall -I$OUTPUT_PREFIX main.c $OUTPUT_PREFIX/miniz.c -o test.out -DMINIZ_USE_UNALIGNED_LOADS_AND_STORES=1
24+
rm test.out
25+
rm main.c
26+
27+
echo "Amalgamation verified."
28+
29+
30+

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
. amalgamate.sh
5+
. amalgamate_and_verify.sh
66

77
cat << "EOF" > miniz_export.h
88
#ifndef MINIZ_EXPORT

0 commit comments

Comments
 (0)