Skip to content

Commit eddd7b6

Browse files
committed
Refactorize testing in runtime
- cases are in cases/ directory - expected output is in expected/ directory - test framework is in cases/lib - 'test' script renamed to 'test_case'
1 parent 53d2b45 commit eddd7b6

8 files changed

Lines changed: 15 additions & 12 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#include "tst_framework.bas"
2+
#include "lib/tst_framework.bas"
33

44
INIT("Testing (byte) == (byte) [EQ8]")
55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#include "tst_framework.bas"
2+
#include "lib/tst_framework.bas"
33

44
INIT("Testing (byte) >= (byte) [GEi8]")
55

tests/runtime/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# vim:et:ts=4:
33

4-
RUN=$(echo $1 | sed -e's/\.bas$//')
4+
RUN=$(basename -s .bas $1)
55
rm -f "$RUN.tzx"
66
../../zxb.py -TaB $1 --debug-memory
77
killall fuse 2>/dev/null

tests/runtime/test

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/runtime/test_case

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# vim:et:ts=4:
3+
4+
# Test a single case (prog.bas file)
5+
# A RAM dump /expected/prog.tzx.scr must exists
6+
7+
echo -n "Testing $(basename $1): "
8+
RUN=$(basename -s .bas $1).tzx
9+
rm -f "$RUN"
10+
../../zxb.py -TaB $1 --debug-memory
11+
./check_test.py "$RUN" "./expected/${RUN}.scr"
12+
rm -f "$RUN"

0 commit comments

Comments
 (0)