collapseos/tools/tests/zasm/runtests.sh
Virgil Dupras a7afbe091e tools/tests: remove scas requirement
I'm about to break compatibility with scas. Before I do that, I
need to adjusts tests. Instead of running scas to compare results,
we commit expected result as binaries directly in the repo.
2019-07-20 17:13:57 -04:00

33 lines
521 B
Bash
Executable File

#!/bin/sh
set -e
TMPFILE=$(mktemp)
KERNEL=../../../kernel
APPS=../../../apps
ZASM=../../zasm.sh
ASMFILE=${APPS}/zasm/instr.asm
cmpas() {
FN=$1
shift 1
EXPECTED=$(xxd ${FN}.expected)
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 *.asm; do
echo "Comparing ${fn}"
cmpas $fn "${KERNEL}" "${APPS}"
done
./errtests.sh