3 # This script runs the entire emu8086 test-suite.
5 # Luiz Fernando Nogueira Capitulino
6 # <lcapitulino@gmail.com>
8 TEST_GROUPS
="control data-transfer arithmetic"
9 EMU_JAR_FILE
="emu8086.jar"
10 GROUP_ORDER
="order.txt"
11 RUN_JAR
="java -jar $EMU_JAR_FILE -b"
16 script="$dtest/test.e"
17 output
="$dtest/output.txt"
18 expected
="$dtest/expected.txt"
20 $RUN_JAR $script > $output 2>&1
22 if [ $ret -eq 0 ]; then
23 cmp -s $expected $output
37 order
="$group/$GROUP_ORDER"
39 if [ ! -f $order ]; then
40 printf "\nERROR: group \"$group\" doesn't have a order file\n"
44 for file in $
(cat $order); do
46 if [ -d "$dtest" ]; then
48 printf " %25s: " $file
64 printf "\nRunning tests:\n"
66 for group
in $TEST_GROUPS; do
73 printf "Checks: %d, " $runs
74 per
=$
(echo "(100 * $success / $runs)" |
bc)
75 printf "Passed: %d (%d%%), " $success $per
76 per
=$
(echo "(100 * $failed / $runs)" |
bc)
77 printf "Failed: %d (%d%%)" $failed $per
85 if [ ! -f "$EMU_JAR_FILE" ]; then
86 printf "ERROR: hm? Wanna run tests without the program?\n"
91 # Run the tests specified in the cmd-line