2020-03-19 15:43:48 -04:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
BASE=../..
|
2020-10-24 14:57:33 -04:00
|
|
|
CVM="${BASE}/cvm/forth"
|
2020-10-24 16:50:22 -04:00
|
|
|
Z80="${BASE}/emul/z80/forth"
|
2020-03-19 15:43:48 -04:00
|
|
|
TMP=$(mktemp)
|
|
|
|
|
|
|
|
chk() {
|
2020-06-27 07:41:42 -04:00
|
|
|
cat ../harness.fs $1 > ${TMP}
|
2020-10-24 14:57:33 -04: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-19 15:43:48 -04: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}
|