collapseos/tests/unit/runtests.sh

30 lines
523 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
# TODO: find POSIX substitute to that PIPESTATUS thing
2019-12-31 13:07:05 -05:00
BASE=../..
TOOLS="${BASE}/tools"
ZASM="${TOOLS}/zasm.sh"
RUNBIN="${TOOLS}/emul/runbin/runbin"
KERNEL="${BASE}/kernel"
APPS="${BASE}/apps"
2019-07-23 09:28:39 -04: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 09:28:39 -04:00
}
if [ ! -z $1 ]; then
2019-07-23 09:28:39 -04:00
chk $1
exit 0
fi
for fn in test_*.asm; do
2019-07-23 09:28:39 -04:00
chk "${fn}"
done
echo "All tests passed!"