2019-12-13 10:23:11 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
# TODO: find POSIX substitute to that PIPESTATUS thing
|
2019-05-17 09:33:20 -04:00
|
|
|
|
2019-12-31 13:07:05 -05:00
|
|
|
BASE=../..
|
2019-12-31 13:32:09 -05:00
|
|
|
ZASM="${BASE}/emul/zasm.sh"
|
|
|
|
RUNBIN="${BASE}/emul/runbin/runbin"
|
2019-06-02 19:54:37 -04:00
|
|
|
KERNEL="${BASE}/kernel"
|
|
|
|
APPS="${BASE}/apps"
|
2019-05-17 09:33:20 -04:00
|
|
|
|
2019-07-23 09:28:39 -04:00
|
|
|
chk() {
|
|
|
|
echo "Running test $1"
|
2019-12-23 15:41:25 -05:00
|
|
|
if ! ${ZASM} "${KERNEL}" "${APPS}" common.asm < $1 | ${RUNBIN}; then
|
2019-05-17 09:33:20 -04:00
|
|
|
echo "failed with code ${PIPESTATUS[1]}"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-07-23 09:28:39 -04:00
|
|
|
}
|
|
|
|
|
2019-12-09 09:36:38 -05:00
|
|
|
if [ ! -z $1 ]; then
|
2019-07-23 09:28:39 -04:00
|
|
|
chk $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-12-23 15:41:25 -05:00
|
|
|
for fn in test_*.asm; do
|
2019-07-23 09:28:39 -04:00
|
|
|
chk "${fn}"
|
2019-05-17 09:33:20 -04:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "All tests passed!"
|