1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-17 05:18:06 +11:00
collapseos/tools/tests/zasm/runtests.sh
Virgil Dupras 22c7eeaa5d Move apps/zasm/tests to tools/tests/zasm
This 'apps' folder is going to disappear. Everything is going to be a
"part" to be assembled through recipes. 'apps' has no meaning.
2019-05-16 11:23:15 -04:00

38 lines
604 B
Bash
Executable File

#!/bin/sh
set -e
TMPFILE=$(mktemp)
SCAS=scas
ZASM=../../emul/zasm
ASMFILE=../../../apps/zasm/instr.asm
cmpas() {
EXPECTED=$($SCAS -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
}
echo "Comparing core.asm"
cmpas ../../../parts/z80/core.asm
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