Skip to content

Commit 7c86925

Browse files
committed
Improve runtime testing script
* Hide errors and warnings in testcases. Not needed here. * Return result test in exitcode * Add a test_all script which runs tests in parallel * Add Makefile
1 parent fc1f304 commit 7c86925

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

tests/runtime/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# vim:ts=4:noet:
2+
3+
.PHONY: test
4+
5+
test:
6+
./test_all
7+

tests/runtime/test_all

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
parallel ./test_case ::: cases/*.bas
4+

tests/runtime/test_case

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
# Test a single case (prog.bas file)
55
# A RAM dump /expected/prog.tzx.scr must exists
66

7+
TIMEOUT=90
8+
TIMEKILL=$((TIMEOUT+30))
9+
710
echo -n "Testing $(basename $1): "
811
RUN=$(basename -s .bas $1).tzx
912
rm -f "$RUN"
10-
../../zxb.py -TaB $1 --debug-memory
11-
./check_test.py "$RUN" "./expected/${RUN}.scr"
12-
rm -f "$RUN"
13+
../../zxb.py -TaB $1 --debug-memory 2>/dev/null
14+
timeout -k $TIMEKILL $TIMEOUT ./check_test.py "$RUN" "./expected/${RUN}.scr"
15+
RETVAL=$?
16+
rm -f "$RUN" 2>/dev/null
17+
exit $RETVAL

0 commit comments

Comments
 (0)