1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-27 18:38:06 +11:00
collapseos/tests/forth/runtests.sh
Virgil Dupras f0cbda1f2e tests: add Forth tests
Modest first step
2020-03-19 15:43:48 -04:00

28 lines
380 B
Bash
Executable File

#!/bin/sh -e
BASE=../..
EXEC="${BASE}/emul/forth/forth"
FDIR="${BASE}/forth"
TMP=$(mktemp)
chk() {
echo "Running test $1"
cat harness.fs $1 > ${TMP}
if ! ${EXEC} ${TMP}; then
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}