1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-24 06:48:06 +11:00
collapseos/tools/tests/unit/runtests.sh
Virgil Dupras a034f63e23 test: begin adding common test harnessing code
This should make tests a bit more convenient to write and debug.

Moreover, begin de de-IX-ization of parseExpr. I have, in a local WIP, a
parseExpr implemented using a recursive descent algo, it passes all tests, but
it unfortunately assembles a faulty zasm. I have to find the expressions that
it doesn't parse properly.

But before I do that, I prefer to commit these significant improvements I've
been making to tests harness in parallel of this development.
2019-12-23 15:41:25 -05:00

30 lines
516 B
Bash
Executable File

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