1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-24 10:28:07 +11:00
collapseos/tools/tests/zasm/runtests.sh

40 lines
674 B
Bash
Raw Normal View History

#!/bin/sh
set -e
TMPFILE=$(mktemp)
SCAS=scas
KERNEL=../../../kernel
2019-05-18 10:47:43 +10:00
APPS=../../../apps
ZASM=../../zasm.sh
2019-05-18 10:47:43 +10:00
ASMFILE=${APPS}/zasm/instr.asm
2019-05-01 05:51:39 +10:00
cmpas() {
FN=$1
shift 1
EXPECTED=$($SCAS -I ${KERNEL} -I ${APPS} -o - "${FN}" | xxd)
ACTUAL=$(cat ${FN} | $ZASM "$@" | xxd)
if [ "$ACTUAL" == "$EXPECTED" ]; then
echo ok
else
echo actual
echo $ACTUAL
echo expected
echo $EXPECTED
exit 1
fi
2019-05-01 05:51:39 +10:00
}
for fn in test*.asm; do
2019-05-15 03:53:12 +10:00
echo "Comparing ${fn}"
cmpas $fn "${KERNEL}" "${APPS}"
2019-05-15 03:53:12 +10:00
done
2019-05-01 05:51:39 +10:00
./geninstrs.py $ASMFILE | \
while read line; do
echo $line | tee "${TMPFILE}"
cmpas ${TMPFILE}
done
./errtests.sh