diff options
Diffstat (limited to 'test')
| -rwxr-xr-x | test/test.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test.sh b/test/test.sh index ce120eb..14b4ca3 100755 --- a/test/test.sh +++ b/test/test.sh | |||
| @@ -8,19 +8,19 @@ TESTERR="test/last.err" | |||
| 8 | CUBEOBJ="debugcube.o" | 8 | CUBEOBJ="debugcube.o" |
| 9 | 9 | ||
| 10 | for t in test/*; do | 10 | for t in test/*; do |
| 11 | if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then | 11 | if [ -n "$re" ] && !(echo "$t" | grep -q "$re"); then |
| 12 | continue | 12 | continue |
| 13 | fi | 13 | fi |
| 14 | 14 | ||
| 15 | # Verify if $t is a directory and if its name starts with three digits | 15 | # Verify if $t is a directory and if its name starts with three digits |
| 16 | if [ -d "$t" ] && echo "$(basename "$t")" | grep -Eq '^[0-9]{3}'; then | 16 | if [ -d "$t" ] && basename "$t" | grep -Eq '^[0-9]{3}'; then |
| 17 | $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1 | 17 | $CC -o $TESTBIN "$t"/*.c $CUBEOBJ || exit 1 |
| 18 | for cin in $t/*.in; do | 18 | for cin in "$t"/*.in; do |
| 19 | c=$(echo "$cin" | sed 's/\.in//') | 19 | c=$(echo "$cin" | sed 's/\.in//') |
| 20 | cout=$c.out | 20 | cout="$c.out" |
| 21 | printf "$c: " | 21 | printf "%s: " "$c" |
| 22 | $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR | 22 | $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR |
| 23 | if diff $cout $TESTOUT; then | 23 | if diff "$cout" "$TESTOUT"; then |
| 24 | printf "OK\n" | 24 | printf "OK\n" |
| 25 | else | 25 | else |
| 26 | printf "Test failed! stderr:\n" | 26 | printf "Test failed! stderr:\n" |
