2019-07-23 23:28:39 +10:00
|
|
|
#!/usr/bin/env bash
|
2019-05-17 23:33:20 +10:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-06-03 09:54:37 +10:00
|
|
|
BASE=../../..
|
|
|
|
TOOLS=../..
|
|
|
|
ZASM="${TOOLS}/zasm.sh"
|
|
|
|
RUNBIN="${TOOLS}/emul/runbin/runbin"
|
|
|
|
KERNEL="${BASE}/kernel"
|
|
|
|
APPS="${BASE}/apps"
|
2019-05-17 23:33:20 +10:00
|
|
|
|
2019-07-23 23:28:39 +10:00
|
|
|
chk() {
|
|
|
|
echo "Running test $1"
|
|
|
|
if ! ${ZASM} "${KERNEL}" "${APPS}" < $1 | ${RUNBIN}; then
|
2019-05-17 23:33:20 +10:00
|
|
|
echo "failed with code ${PIPESTATUS[1]}"
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-07-23 23:28:39 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
if [[ ! -z $1 ]]; then
|
|
|
|
chk $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
for fn in *.asm; do
|
|
|
|
chk "${fn}"
|
2019-05-17 23:33:20 +10:00
|
|
|
done
|
|
|
|
|
|
|
|
echo "All tests passed!"
|