1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-09-07 04:18:50 +10:00
collapseos/apps/zasm/tests/runtests.sh
Virgil Dupras f6dddaa380 zasm: add automated tests and fix a bunch of bugs
A python script generates all possibilities for all supported
instructions and compare zasm output with scas. After having fixed a
couple of bugs, all tests pass!
2019-04-17 21:03:20 -04:00

24 lines
404 B
Bash
Executable File

#!/bin/sh
set -e
TMPFILE=$(mktemp)
SCAS=scas
ZASM=../emul/zasm
./geninstrs.py | \
while read line; do
echo $line | tee "${TMPFILE}"
EXPECTED=$($SCAS -o - "${TMPFILE}" | xxd)
ACTUAL=$(echo $line | $ZASM | xxd)
if [ "$ACTUAL" == "$EXPECTED" ]; then
echo ok
else
echo actual
echo $ACTUAL
echo expected
echo $EXPECTED
exit 1
fi
done