2017-08-28 20:58:09 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-04-25 20:59:49 -07:00
|
|
|
# Run this from the desk.acc directory
|
|
|
|
|
2017-08-28 20:58:09 -07:00
|
|
|
set -e
|
2018-11-25 21:16:39 -08:00
|
|
|
source "../res/util.sh"
|
2017-08-28 20:58:09 -07:00
|
|
|
|
2017-09-05 18:41:13 -07:00
|
|
|
function verify {
|
2018-04-25 20:59:49 -07:00
|
|
|
diff "orig/$1.bin" "out/$1.built" \
|
2018-02-19 10:49:45 -08:00
|
|
|
&& (cecho green "diff $1 good" ) \
|
|
|
|
|| (tput blink ; cecho red "DIFF $1 BAD" ; return 1)
|
2017-09-05 18:41:13 -07:00
|
|
|
}
|
|
|
|
|
2017-09-13 20:09:36 -07:00
|
|
|
function stats {
|
2018-03-05 21:20:00 -08:00
|
|
|
echo "$(printf '%-20s' $1)""$(../res/stats.pl < $1)"
|
2017-09-13 20:09:36 -07:00
|
|
|
}
|
|
|
|
|
2017-09-06 21:33:22 -07:00
|
|
|
#do_make clean
|
|
|
|
do_make all
|
|
|
|
|
2017-08-28 20:58:09 -07:00
|
|
|
# Verify original and output match
|
2017-09-13 20:09:36 -07:00
|
|
|
echo "Verifying diffs:"
|
2017-09-05 18:41:13 -07:00
|
|
|
verify "calculator"
|
2018-02-21 21:18:46 -08:00
|
|
|
verify "show.text.file"
|
2017-09-10 20:18:29 -07:00
|
|
|
verify "date"
|
|
|
|
verify "puzzle"
|
2018-04-19 21:23:23 -07:00
|
|
|
verify "sort.directory"
|
2017-08-28 20:58:09 -07:00
|
|
|
|
2018-02-21 21:18:46 -08:00
|
|
|
# Compute stats
|
2018-03-05 21:20:00 -08:00
|
|
|
echo "Stats:"
|
2017-09-13 20:09:36 -07:00
|
|
|
stats "calculator.s"
|
2018-02-21 21:18:46 -08:00
|
|
|
stats "show.text.file.s"
|
2017-09-13 20:09:36 -07:00
|
|
|
stats "date.s"
|
|
|
|
stats "puzzle.s"
|
2018-04-19 21:23:23 -07:00
|
|
|
stats "sort.directory.s"
|