diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-10 17:39:32 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-08-10 17:39:32 +0200 |
| commit | 4a016679d1f5f33ab0679dfc315222797075dc65 (patch) | |
| tree | 3cde6b560163d3e404d202d9b396476417c5af93 /test/test.sh | |
| parent | dc64668ceba09cd048fb92af77857b594c584c27 (diff) | |
| parent | c0d829e588c5d25ee0fc0ff3212658c92c0fb0a8 (diff) | |
| download | nissy-core-4a016679d1f5f33ab0679dfc315222797075dc65.tar.gz nissy-core-4a016679d1f5f33ab0679dfc315222797075dc65.zip | |
Merge branch 'master' of github.com:sebastianotronto/h48
Diffstat (limited to 'test/test.sh')
| -rwxr-xr-x | test/test.sh | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/test/test.sh b/test/test.sh index 33613b1..ce120eb 100755 --- a/test/test.sh +++ b/test/test.sh | |||
| @@ -11,21 +11,24 @@ for t in test/*; do | |||
| 11 | if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then | 11 | if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then |
| 12 | continue | 12 | continue |
| 13 | fi | 13 | fi |
| 14 | if [ ! -d $t ]; then continue; fi | 14 | |
| 15 | $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1; | 15 | # Verify if $t is a directory and if its name starts with three digits |
| 16 | for cin in $t/*.in; do | 16 | if [ -d "$t" ] && echo "$(basename "$t")" | grep -Eq '^[0-9]{3}'; then |
| 17 | c=$(echo "$cin" | sed 's/\.in//') | 17 | $CC -o $TESTBIN $t/*.c $CUBEOBJ || exit 1 |
| 18 | cout=$c.out | 18 | for cin in $t/*.in; do |
| 19 | printf "$c: " | 19 | c=$(echo "$cin" | sed 's/\.in//') |
| 20 | $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR | 20 | cout=$c.out |
| 21 | if diff $cout $TESTOUT; then | 21 | printf "$c: " |
| 22 | printf "OK\n" | 22 | $TESTBIN < "$cin" > $TESTOUT 2> $TESTERR |
| 23 | else | 23 | if diff $cout $TESTOUT; then |
| 24 | printf "Test failed! stderr:\n" | 24 | printf "OK\n" |
| 25 | cat $TESTERR | 25 | else |
| 26 | exit 1 | 26 | printf "Test failed! stderr:\n" |
| 27 | fi | 27 | cat $TESTERR |
| 28 | done | 28 | exit 1 |
| 29 | fi | ||
| 30 | done | ||
| 31 | fi | ||
| 29 | done | 32 | done |
| 30 | 33 | ||
| 31 | echo "All tests passed!" | 34 | echo "All tests passed!" |
