summaryrefslogtreecommitdiff
path: root/tests/run_script_test.sh
diff options
context:
space:
mode:
authorpeter <peter@pmikkelsen.com>2026-10-07 19:14:04 +0000
committerpeter <peter@pmikkelsen.com>2026-10-07 19:14:04 +0000
commit66993321af1e67570469a2b9a9731492d0aaff5b (patch)
tree963db5f8777efaf73283ed9ca7d8e3a24d61ea6e /tests/run_script_test.sh
parent09a882746304791e9462bec3df746f9203594d34 (diff)
[de3a009ef3] Write a very basic "hello world" test which verifies that the program outputs the correct message.
This fails for now, as the interpreter isn't implemented yet, but it's a good way to start doing test-driven development. FossilOrigin-Name: f34934025a9f22b574c1076b05673b94a4f40d8a55c723fced7c055155042c57
Diffstat (limited to 'tests/run_script_test.sh')
-rwxr-xr-xtests/run_script_test.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/run_script_test.sh b/tests/run_script_test.sh
index a6ccfa8..21c4e04 100755
--- a/tests/run_script_test.sh
+++ b/tests/run_script_test.sh
@@ -39,13 +39,25 @@ case $expected in
;;
esac
-"$1"
-check $?
+if [ -x "$1" ]
+then
+ "$1"
+ check $?
+fi
case "$ext" in
aplwc)
- aplwc "$1"
+ aplwc -x "$1"
check $?
+
+ if [ -f "$1.output" ]
+ then
+ aplwc -x "$1" 2>&1 | cmp - "$1.output"
+ if [ "$?" -ne 0 ]
+ then
+ exit 1
+ fi
+ fi
;;
esac