commit 00c9bff7f9f091517f38893332ecd402449a22a8 from: Sven M. Hallberg date: Sat Sep 10 22:54:50 2022 UTC compare tests' output against expectation Includes expected output for hello.hack (hello.out). commit - 1192038877397dc033e0476f01342fe5ee0e7cfc commit + 00c9bff7f9f091517f38893332ecd402449a22a8 blob - /dev/null blob + b14df6442ea5a1b382985a6549b85d435376c351 (mode 644) --- /dev/null +++ hello.out @@ -0,0 +1 @@ +Hi blob - 6c52061b4721ce12e1d2cfe5e8467c575f2c4b94 blob + c6e5bde007a80833ccb58a9a6feb08d52721e23e --- test.sh +++ test.sh @@ -3,17 +3,24 @@ result=0 t=$(mktemp) +o=$(mktemp) for rom in "$@" do - if ! hackem -t $t $rom + base=$(basename $rom .rom) + + if ! hackem -t $t $rom >$o then - echo ERROR: $rom - result=$((result | 2)) + echo "ERROR: $rom (exit $?)" >/dev/stderr + result=$((result | 8)) fi - if ! diff -u $(basename $rom .rom).tsv $t + if ! diff -u $base.tsv $t then - echo FAIL: $rom + echo "FAIL: $rom (bad trace)" >/dev/stderr result=$((result | 1)) + elif [ -f $base.out ] && ! diff -u $base.out $o + then + echo "FAIL: $rom (bad output)" >/dev/stderr + result=$((result | 2)) else echo ok: $rom fi