aboutsummaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-09-18 07:56:39 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-09-18 07:56:39 +0200
commit65878aa07452b45c3f17c3ab15508400edd46476 (patch)
tree7a49e17ecd40552d9c090fb85db9d2fa6bcc63a0 /test/test.sh
parente0f9f9929d80d2c21ae1996b437d9209d498956b (diff)
downloadnissy-core-65878aa07452b45c3f17c3ab15508400edd46476.tar.gz
nissy-core-65878aa07452b45c3f17c3ab15508400edd46476.zip
Some shellcheck
Diffstat (limited to '')
-rwxr-xr-xtest/test.sh14
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"
8CUBEOBJ="debugcube.o" 8CUBEOBJ="debugcube.o"
9 9
10for t in test/*; do 10for 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"

Generated with cgit - Back to sebastiano.tronto.net