diff --git a/src/Makefile b/src/Makefile index 78152fe..4c0e1de 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,11 +1,16 @@ +files = pebblisp.c tokens.c object.c env.c + all: - gcc -g -O0 -o pebblisp -D STANDALONE pebblisp.c tokens.c object.c env.c && ./tests.sh + gcc -g -O0 -o pebblisp -D STANDALONE $(files) && ./tests.sh + +notest: + gcc -g -O0 -o pebblisp -D STANDALONE $(files) val: - gcc -g -O0 -o pebblisp -D STANDALONE pebblisp.c tokens.c object.c env.c && ./tests.sh -val + gcc -g -O0 -o pebblisp -D STANDALONE $(files) && ./tests.sh -val debug: - gcc -g -O0 -o pebblisp -D STANDALONE -D DEBUG pebblisp.c tokens.c object.c env.c && ./tests.sh + gcc -g -O0 -o pebblisp -D STANDALONE -D DEBUG $(files) && ./tests.sh run: ./pebblisp diff --git a/src/tests.sh b/src/tests.sh index cea3b16..8385a01 100755 --- a/src/tests.sh +++ b/src/tests.sh @@ -20,7 +20,7 @@ fail() { check() { local output if (($VALGRIND == 1)); then - local output=$(valgrind --leak-check=full ./pebblisp "$2") + local output=$(valgrind --leak-check=full --track-origins=yes ./pebblisp "$2") else local output=$(./pebblisp "$2") fi @@ -79,7 +79,9 @@ echo "" check "ExplicitCat" "(cat \"Big\" \" Kitty\")" "Big Kitty" check "CatNums" "(cat \"There are \" (+ 2 3) \" kitties\")" "There are 5 kitties" check "ImplicitCat" "(+ \"There are \" (* 5 4) \" bonks\")" "There are 20 bonks" +# Not recommended check "CatAssocLeft" "(+ 10 20 \" rascals\")" "30 rascals" +echo"" if [ "$FAILS" -ne "0" ]; then echo "$FAILS Tests Failed" @@ -88,3 +90,4 @@ else fi echo "$PASSES Tests Passed" +echo ""