1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-09-07 08:38:46 +10:00
collapseos/tools/tests/zasm/runtests.sh
Virgil Dupras 9a72f10221 zasm: includes CFS is now built on-the-fly by zasm.sh
This makes for a much more usable zasm linux binary that doesn't have to
be rebuilt every time apps or kernel change.
2019-06-02 19:57:40 -04:00

40 lines
674 B
Bash
Executable File

#!/bin/sh
set -e
TMPFILE=$(mktemp)
SCAS=scas
KERNEL=../../../kernel
APPS=../../../apps
ZASM=../../zasm.sh
ASMFILE=${APPS}/zasm/instr.asm
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
}
for fn in test*.asm; do
echo "Comparing ${fn}"
cmpas $fn "${KERNEL}" "${APPS}"
done
./geninstrs.py $ASMFILE | \
while read line; do
echo $line | tee "${TMPFILE}"
cmpas ${TMPFILE}
done
./errtests.sh