1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-21 02:18:06 +11:00
collapseos/tools/tests/zasm/runtests.sh
Virgil Dupras 213614af33 lib/expr: make recursion process a bit more orderly
Instead of going left and right, finding operators chars and replacing them
with nulls, we parse expressions in a more orderly manner, one chunk at a
time. I think it qualifies as "recursive descent", but I'm not sure.

This allows us to preserve the string we parse and should also make the
implementation of parens much easier.
2019-12-29 11:42:18 -05:00

34 lines
533 B
Bash
Executable File

#!/bin/sh -e
KERNEL=../../../kernel
APPS=../../../apps
ZASM=../../zasm.sh
ASMFILE=${APPS}/zasm/instr.asm
cmpas() {
FN=$1
EXPECTED=$(xxd ${FN}.expected)
ACTUAL=$(cat ${FN} | $ZASM "${KERNEL}" "${APPS}" | xxd)
if [ "$ACTUAL" = "$EXPECTED" ]; then
echo ok
else
echo actual
echo "$ACTUAL"
echo expected
echo "$EXPECTED"
exit 1
fi
}
if [ ! -z $1 ]; then
cmpas $1
exit 0
fi
for fn in *.asm; do
echo "Comparing ${fn}"
cmpas $fn
done
./errtests.sh