Clean up makefile and tests
This commit is contained in:
parent
58705b4aa9
commit
82f1f03d7b
11
src/Makefile
11
src/Makefile
|
@ -1,11 +1,16 @@
|
||||||
|
files = pebblisp.c tokens.c object.c env.c
|
||||||
|
|
||||||
all:
|
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:
|
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:
|
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:
|
run:
|
||||||
./pebblisp
|
./pebblisp
|
||||||
|
|
|
@ -20,7 +20,7 @@ fail() {
|
||||||
check() {
|
check() {
|
||||||
local output
|
local output
|
||||||
if (($VALGRIND == 1)); then
|
if (($VALGRIND == 1)); then
|
||||||
local output=$(valgrind --leak-check=full ./pebblisp "$2")
|
local output=$(valgrind --leak-check=full --track-origins=yes ./pebblisp "$2")
|
||||||
else
|
else
|
||||||
local output=$(./pebblisp "$2")
|
local output=$(./pebblisp "$2")
|
||||||
fi
|
fi
|
||||||
|
@ -79,7 +79,9 @@ echo ""
|
||||||
check "ExplicitCat" "(cat \"Big\" \" Kitty\")" "Big Kitty"
|
check "ExplicitCat" "(cat \"Big\" \" Kitty\")" "Big Kitty"
|
||||||
check "CatNums" "(cat \"There are \" (+ 2 3) \" kitties\")" "There are 5 kitties"
|
check "CatNums" "(cat \"There are \" (+ 2 3) \" kitties\")" "There are 5 kitties"
|
||||||
check "ImplicitCat" "(+ \"There are \" (* 5 4) \" bonks\")" "There are 20 bonks"
|
check "ImplicitCat" "(+ \"There are \" (* 5 4) \" bonks\")" "There are 20 bonks"
|
||||||
|
# Not recommended
|
||||||
check "CatAssocLeft" "(+ 10 20 \" rascals\")" "30 rascals"
|
check "CatAssocLeft" "(+ 10 20 \" rascals\")" "30 rascals"
|
||||||
|
echo""
|
||||||
|
|
||||||
if [ "$FAILS" -ne "0" ]; then
|
if [ "$FAILS" -ne "0" ]; then
|
||||||
echo "[1;31m$FAILS Tests Failed[0m"
|
echo "[1;31m$FAILS Tests Failed[0m"
|
||||||
|
@ -88,3 +90,4 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[1;32m$PASSES Tests Passed[0m"
|
echo "[1;32m$PASSES Tests Passed[0m"
|
||||||
|
echo ""
|
||||||
|
|
Loading…
Reference in New Issue