1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-27 08:58:06 +11:00
collapseos/tests/unit/runtests.sh

29 lines
506 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
# TODO: find POSIX substitute to that PIPESTATUS thing
2020-01-01 05:07:05 +11:00
BASE=../..
ZASM="${BASE}/emul/zasm/zasm"
2020-01-01 05:32:09 +11:00
RUNBIN="${BASE}/emul/runbin/runbin"
KERNEL="${BASE}/kernel"
APPS="${BASE}/apps"
2019-07-23 23:28:39 +10:00
chk() {
echo "Running test $1"
if ! ${ZASM} "${KERNEL}" "${APPS}" common.asm < $1 | ${RUNBIN}; then
echo "failed with code ${PIPESTATUS[1]}"
exit 1
fi
2019-07-23 23:28:39 +10:00
}
if [ ! -z $1 ]; then
2019-07-23 23:28:39 +10:00
chk $1
exit 0
fi
for fn in test_*.asm; do
2019-07-23 23:28:39 +10:00
chk "${fn}"
done
echo "All tests passed!"