aboutsummaryrefslogtreecommitdiff
path: root/shell/test.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-10-12 10:21:52 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-10-12 10:22:50 +0200
commit9b680fadec01789c1fb1317b939c15d186a572c9 (patch)
treed9038076657ec3cf887e5fd2bd14f0155ac25b7e /shell/test.sh
parentc4f64cf2556c0f8597e1fbc19d7c664b8da94612 (diff)
downloadnissy-core-9b680fadec01789c1fb1317b939c15d186a572c9.tar.gz
nissy-core-9b680fadec01789c1fb1317b939c15d186a572c9.zip
Added shelltest
Will add more tests when I feel like it
Diffstat (limited to 'shell/test.sh')
-rwxr-xr-xshell/test.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/shell/test.sh b/shell/test.sh
new file mode 100755
index 0000000..de888ef
--- /dev/null
+++ b/shell/test.sh
@@ -0,0 +1,22 @@
1#!/bin/sh
2
3SHELLBIN="./run"
4TESTDIR="./shell/testcases"
5TESTOUT="shell/lasttest.out"
6TESTERR="shell/lasttest.err"
7
8for cin in "$TESTDIR"/*.in; do
9 c=$(echo "$cin" | sed 's/\.in//')
10 cout="$c.out"
11 printf "%s: " "$c"
12 (cat "$cin" | xargs "$SHELLBIN") > $TESTOUT 2> $TESTERR
13 if diff "$cout" "$TESTOUT"; then
14 printf "OK\n"
15 else
16 printf "Test failed! stderr:\n"
17 cat $TESTERR
18 exit 1
19 fi
20done
21
22echo "All tests passed!"

Generated with cgit - Back to sebastiano.tronto.net