diff options
Diffstat (limited to '')
| -rw-r--r-- | .gitignore | 1 | ||||
| -rwxr-xr-x | test/test.sh | 7 |
2 files changed, 6 insertions, 2 deletions
| @@ -1,3 +1,4 @@ | |||
| 1 | test/*/runtest | 1 | test/*/runtest |
| 2 | test/run | 2 | test/run |
| 3 | test/last.* | 3 | test/last.* |
| 4 | test/*.o | ||
diff --git a/test/test.sh b/test/test.sh index fb932af..5e17d33 100755 --- a/test/test.sh +++ b/test/test.sh | |||
| @@ -9,10 +9,13 @@ SRC="src/cube_array.c" | |||
| 9 | TESTBIN="test/run" | 9 | TESTBIN="test/run" |
| 10 | TESTOUT="test/last.out" | 10 | TESTOUT="test/last.out" |
| 11 | TESTERR="test/last.err" | 11 | TESTERR="test/last.err" |
| 12 | CUBEOBJ="test/cube.o" | ||
| 13 | |||
| 14 | $CC -c $SRC -o $CUBEOBJ | ||
| 12 | 15 | ||
| 13 | for t in test/*; do | 16 | for t in test/*; do |
| 14 | if [ ! -d $t ]; then continue; fi | 17 | if [ ! -d $t ]; then continue; fi |
| 15 | $CC -o $TESTBIN $t/*.c $SRC || exit 1; | 18 | $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1; |
| 16 | for cin in $t/*.in; do | 19 | for cin in $t/*.in; do |
| 17 | c=$(echo "$cin" | sed 's/\.in//') | 20 | c=$(echo "$cin" | sed 's/\.in//') |
| 18 | cout=$c.out | 21 | cout=$c.out |
| @@ -29,4 +32,4 @@ for t in test/*; do | |||
| 29 | done | 32 | done |
| 30 | 33 | ||
| 31 | echo "All tests passed!" | 34 | echo "All tests passed!" |
| 32 | rm -rf $TESTBIN $TESTOUT $TESTERR | 35 | rm -rf $TESTBIN $TESTOUT $TESTERR $CUBEOBJ |
