Write invariant tests for desugaring

This commit is contained in:
2024-10-26 15:38:48 +01:00
parent 2bcdfbcd61
commit 9494c08f36
5 changed files with 189 additions and 1 deletions

View File

@@ -8,9 +8,12 @@ if [ ! -e build ]; then mkdir build; else rm build/*; fi
# Build library
clang $CFLAGS -Ilib -c lib/parse.c -o build/parse.o
ar -crs build/lib.a build/parse.o build/regex.o
clang $CFLAGS -Ilib -c lib/desugar.c -o build/desugar.o
ar -crs build/lib.a build/parse.o build/desugar.o
# Build tests
clang $CFLAGS -Itests -c tests/testing.c -o build/testing.o
clang $CFLAGS -Ilib -Itests -o build/parse_tests \
tests/parse_tests.c build/testing.o build/lib.a
clang $CFLAGS -Ilib -Itests -o build/desugar_tests \
tests/desugar_tests.c build/testing.o build/lib.a

View File

@@ -3,5 +3,6 @@ cd "$(git rev-parse --show-toplevel)"
fails=0
build/parse_tests || fails=`expr $fails + 1`
build/desugar_tests || fails=`expr $fails + 1`
if [ $fails -eq 0 ]; then echo Tests OK; fi