2019-10-11 06:22:21 +11:00
|
|
|
#!/usr/bin/env bash
|
2019-04-18 11:03:20 +10:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-05-20 01:19:41 +10:00
|
|
|
KERNEL=../../../kernel
|
2019-05-18 10:47:43 +10:00
|
|
|
APPS=../../../apps
|
2019-06-03 05:50:59 +10:00
|
|
|
ZASM=../../zasm.sh
|
2019-05-18 10:47:43 +10:00
|
|
|
ASMFILE=${APPS}/zasm/instr.asm
|
2019-04-18 11:03:20 +10:00
|
|
|
|
2019-05-01 05:51:39 +10:00
|
|
|
cmpas() {
|
2019-06-03 09:54:37 +10:00
|
|
|
FN=$1
|
2019-07-21 07:13:57 +10:00
|
|
|
EXPECTED=$(xxd ${FN}.expected)
|
2019-07-21 08:07:52 +10:00
|
|
|
ACTUAL=$(cat ${FN} | $ZASM "${KERNEL}" "${APPS}" | xxd)
|
2019-04-18 11:03:20 +10:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-07-21 08:07:52 +10:00
|
|
|
if [[ ! -z $1 ]]; then
|
|
|
|
cmpas $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-07-21 07:13:57 +10:00
|
|
|
for fn in *.asm; do
|
2019-05-15 03:53:12 +10:00
|
|
|
echo "Comparing ${fn}"
|
2019-07-21 08:07:52 +10:00
|
|
|
cmpas $fn
|
2019-05-15 03:53:12 +10:00
|
|
|
done
|
|
|
|
|
2019-05-28 01:04:31 +10:00
|
|
|
./errtests.sh
|