2020-03-20 06:43:48 +11:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
BASE=../..
|
2020-10-25 05:57:33 +11:00
|
|
|
CVM="${BASE}/cvm/forth"
|
2020-10-25 07:50:22 +11:00
|
|
|
Z80="${BASE}/emul/z80/forth"
|
2020-03-20 06:43:48 +11:00
|
|
|
TMP=$(mktemp)
|
|
|
|
|
|
|
|
chk() {
|
2020-06-27 21:41:42 +10:00
|
|
|
cat ../harness.fs $1 > ${TMP}
|
2020-10-25 05:57:33 +11:00
|
|
|
echo "Running test $1 under CVM"
|
|
|
|
if ! ${CVM} ${TMP}; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "Running test $1 under Z80"
|
|
|
|
if ! ${Z80} ${TMP}; then
|
2020-03-20 06:43:48 +11:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -z $1 ]; then
|
|
|
|
chk $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# those tests run without any builtin
|
|
|
|
for fn in test_*.fs; do
|
|
|
|
chk "${fn}"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "All tests passed!"
|
|
|
|
rm ${TMP}
|