diff options
| author | enricotenuti <tenutz_27@outlook.it> | 2024-08-07 20:09:12 +0200 |
|---|---|---|
| committer | enricotenuti <tenutz_27@outlook.it> | 2024-08-07 20:09:12 +0200 |
| commit | d613e7258bca459a59cdb7b4fb8a7cb041137377 (patch) | |
| tree | 28b3341cf75e2348a26ab9ee44f386c9cda22cfd /test/test.sh | |
| parent | f148aa65dfe587e7b5d2f48b5005be670788dbe6 (diff) | |
| download | nissy-core-d613e7258bca459a59cdb7b4fb8a7cb041137377.tar.gz nissy-core-d613e7258bca459a59cdb7b4fb8a7cb041137377.zip | |
cube_neon ver1
Diffstat (limited to '')
| -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..4325c91 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 | # Verifica se $t รจ una directory e se il suo nome inizia con tre cifre |
| 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!" |
