Implement first iteration of parser and write test scripts
This commit is contained in:
@@ -7,5 +7,11 @@ CFLAGS="$CFLAGS -O0 -ggdb"
|
||||
mkdir -p build
|
||||
|
||||
# Build library
|
||||
clang $CFLAGS -Ilib -c lib/parser.c -o build/parser.o
|
||||
clang $CFLAGS -Ilib -c lib/regex.c -o build/regex.o
|
||||
ar -crs build/lib.a build/regex.o
|
||||
ar -crs build/lib.a build/parser.o build/regex.o
|
||||
|
||||
# Build tests
|
||||
clang $CFLAGS -Itests -c tests/testing.c -o build/testing.o
|
||||
clang $CFLAGS -Ilib -Itests -o build/parser_tests \
|
||||
tests/parser_tests.c build/testing.o build/lib.a
|
||||
|
||||
3
scripts/entr.sh
Normal file
3
scripts/entr.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
find . -not \( -path './.git' -prune \) -not \( -path './build' -prune \) \
|
||||
| entr -s 'clear && sh scripts/build.sh && sh scripts/test.sh'
|
||||
7
scripts/test.sh
Normal file
7
scripts/test.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
|
||||
fails=0
|
||||
|
||||
build/parser_tests || fails=`expr $fails + 1`
|
||||
|
||||
if [ $fails -eq 0 ]; then echo Tests OK; fi
|
||||
Reference in New Issue
Block a user