1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-06 10:28:08 +11:00
collapseos/tools/tests/zasm/runtests.sh
Virgil Dupras 7fad3b0c90 Move /parts/z80 to /kernel
Let go of that "meta os" thing. it's not as meta as I made it sound
like. It's a kernel.
2019-05-19 11:19:41 -04:00

37 lines
608 B
Bash
Executable File

#!/bin/sh
set -e
TMPFILE=$(mktemp)
SCAS=scas
KERNEL=../../../kernel
APPS=../../../apps
ZASM=../../emul/zasm/zasm
ASMFILE=${APPS}/zasm/instr.asm
cmpas() {
EXPECTED=$($SCAS -I ${KERNEL} -I ${APPS} -o - "$1" | xxd)
ACTUAL=$(cat $1 | $ZASM | xxd)
if [ "$ACTUAL" == "$EXPECTED" ]; then
echo ok
else
echo actual
echo $ACTUAL
echo expected
echo $EXPECTED
exit 1
fi
}
for fn in *.asm; do
echo "Comparing ${fn}"
cmpas $fn
done
./geninstrs.py $ASMFILE | \
while read line; do
echo $line | tee "${TMPFILE}"
cmpas ${TMPFILE}
done