2019-12-13 17:38:40 -05:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2019-12-31 13:07:05 -05:00
|
|
|
ZASM=../../tools/zasm.sh
|
|
|
|
AVRINC=../../avr
|
2019-12-13 17:38:40 -05:00
|
|
|
|
|
|
|
cmpas() {
|
|
|
|
FN=$1
|
|
|
|
EXPECTED=$(xxd ${FN%.*}.expected)
|
2019-12-15 09:38:01 -05:00
|
|
|
ACTUAL=$(cat ${FN} | "${ZASM}" -a "${AVRINC}" | xxd)
|
2019-12-13 17:38:40 -05:00
|
|
|
if [ "$ACTUAL" = "$EXPECTED" ]; then
|
|
|
|
echo ok
|
|
|
|
else
|
|
|
|
echo actual
|
|
|
|
echo "$ACTUAL"
|
|
|
|
echo expected
|
|
|
|
echo "$EXPECTED"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ ! -z $1 ]; then
|
|
|
|
cmpas $1
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
for fn in *.asm; do
|
|
|
|
echo "Comparing ${fn}"
|
|
|
|
cmpas $fn
|
|
|
|
done
|