| 1 | #!/bin/bash |
| 2 | |
| 3 | check() { |
| 4 | #echo "$@" |
| 5 | FILE="$1" |
| 6 | shift |
| 7 | acme "$@" outformats.a || exit 1 |
| 8 | cmp test.o "$FILE" || exit 1 |
| 9 | rm test.o |
| 10 | } |
| 11 | |
| 12 | # if neither -o nor -f are given, use format from "!to", which defaults to cbm: |
| 13 | check outformat-cbm.exp -DFORMAT=0 |
| 14 | check outformat-plain.exp -DFORMAT=1 |
| 15 | check outformat-cbm.exp -DFORMAT=2 |
| 16 | check outformat-apple.exp -DFORMAT=3 |
| 17 | |
| 18 | # if -o or -f are given, format from "!to" should be ignored: |
| 19 | for f in 0 1 2 3 ; do |
| 20 | check outformat-plain.exp -DFORMAT=$f -f plain |
| 21 | check outformat-cbm.exp -DFORMAT=$f -f cbm |
| 22 | check outformat-apple.exp -DFORMAT=$f -f apple |
| 23 | check outformat-plain.exp -DFORMAT=$f -o test.o # defaults to plain |
| 24 | check outformat-plain.exp -DFORMAT=$f -o test.o -f plain |
| 25 | check outformat-cbm.exp -DFORMAT=$f -o test.o -f cbm |
| 26 | check outformat-apple.exp -DFORMAT=$f -o test.o -f apple |
| 27 | done |