aboutsummaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-08-10 17:40:37 +0200
committerGitHub <noreply@github.com>2024-08-10 17:40:37 +0200
commitc0d829e588c5d25ee0fc0ff3212658c92c0fb0a8 (patch)
tree39811fc48570ef219326fb23b2571ae27c55131a /test/test.sh
parentf148aa65dfe587e7b5d2f48b5005be670788dbe6 (diff)
parent23c95fa1b64f35ba56594acc0bf06962647c4ba0 (diff)
downloadnissy-core-c0d829e588c5d25ee0fc0ff3212658c92c0fb0a8.tar.gz
nissy-core-c0d829e588c5d25ee0fc0ff3212658c92c0fb0a8.zip
Merge pull request #1 from enricotenuti/master
cube_neon ver1
Diffstat (limited to 'test/test.sh')
-rwxr-xr-xtest/test.sh33
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
29done 32done
30 33
31echo "All tests passed!" 34echo "All tests passed!"

Generated with cgit - Back to sebastiano.tronto.net