2019-12-10 01:36:38 +11:00
|
|
|
#!/bin/sh -e
|
2019-04-18 11:03:20 +10:00
|
|
|
|
2020-01-01 05:07:05 +11:00
|
|
|
BASE=../..
|
|
|
|
KERNEL="${BASE}/kernel"
|
|
|
|
APPS="${BASE}/apps"
|
2020-01-01 07:07:39 +11:00
|
|
|
ZASM="${BASE}/emul/zasm/zasm"
|
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-12-10 01:36:38 +11:00
|
|
|
if [ "$ACTUAL" = "$EXPECTED" ]; then
|
2019-04-18 11:03:20 +10:00
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo actual
|
2019-12-30 03:42:18 +11:00
|
|
|
echo "$ACTUAL"
|
2019-04-18 11:03:20 +10:00
|
|
|
echo expected
|
2019-12-30 03:42:18 +11:00
|
|
|
echo "$EXPECTED"
|
2019-04-18 11:03:20 +10:00
|
|
|
exit 1
|
|
|
|
fi
|
2019-05-01 05:51:39 +10:00
|
|
|
}
|
|
|
|
|
2019-12-10 01:36:38 +11:00
|
|
|
if [ ! -z $1 ]; then
|
2019-07-21 08:07:52 +10:00
|
|
|
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
|