2019-04-17 21:03:20 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-05-19 11:19:41 -04:00
|
|
|
KERNEL=../../../kernel
|
2019-05-17 20:47:43 -04:00
|
|
|
APPS=../../../apps
|
2019-06-02 15:50:59 -04:00
|
|
|
ZASM=../../zasm.sh
|
2019-05-17 20:47:43 -04:00
|
|
|
ASMFILE=${APPS}/zasm/instr.asm
|
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-04-17 21:03:20 -04:00
|
|
|
if [ "$ACTUAL" == "$EXPECTED" ]; then
|
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo actual
|
|
|
|
echo $ACTUAL
|
|
|
|
echo expected
|
|
|
|
echo $EXPECTED
|
|
|
|
exit 1
|
|
|
|
fi
|
2019-04-30 15:51:39 -04:00
|
|
|
}
|
|
|
|
|
2019-07-20 18:07:52 -04:00
|
|
|
if [[ ! -z $1 ]]; then
|
|
|
|
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
|