2019-12-09 09:36:38 -05:00
|
|
|
#!/bin/sh -e
|
2019-04-17 21:03:20 -04:00
|
|
|
|
2019-12-31 13:07:05 -05:00
|
|
|
BASE=../..
|
|
|
|
KERNEL="${BASE}/kernel"
|
|
|
|
APPS="${BASE}/apps"
|
2019-12-31 15:07:39 -05:00
|
|
|
ZASM="${BASE}/emul/zasm/zasm"
|
2019-04-17 21:03:20 -04:00
|
|
|
|
2019-04-30 15:51:39 -04:00
|
|
|
cmpas() {
|
2019-06-02 19:54:37 -04:00
|
|
|
FN=$1
|
2019-07-20 17:13:57 -04:00
|
|
|
EXPECTED=$(xxd ${FN}.expected)
|
2019-07-20 18:07:52 -04:00
|
|
|
ACTUAL=$(cat ${FN} | $ZASM "${KERNEL}" "${APPS}" | xxd)
|
2019-12-09 09:36:38 -05:00
|
|
|
if [ "$ACTUAL" = "$EXPECTED" ]; then
|
2019-04-17 21:03:20 -04:00
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo actual
|
2019-12-29 11:42:18 -05:00
|
|
|
echo "$ACTUAL"
|
2019-04-17 21:03:20 -04:00
|
|
|
echo expected
|
2019-12-29 11:42:18 -05:00
|
|
|
echo "$EXPECTED"
|
2019-04-17 21:03:20 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
2019-04-30 15:51:39 -04:00
|
|
|
}
|
|
|
|
|
2019-12-09 09:36:38 -05:00
|
|
|
if [ ! -z $1 ]; then
|
2019-07-20 18:07:52 -04:00
|
|
|
cmpas $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-07-20 17:13:57 -04:00
|
|
|
for fn in *.asm; do
|
2019-05-14 13:53:12 -04:00
|
|
|
echo "Comparing ${fn}"
|
2019-07-20 18:07:52 -04:00
|
|
|
cmpas $fn
|
2019-05-14 13:53:12 -04:00
|
|
|
done
|
|
|
|
|
2019-05-27 11:04:31 -04:00
|
|
|
./errtests.sh
|