From c35403276b728aefba856f7246bad3adae2de089 Mon Sep 17 00:00:00 2001 From: Egan Ford Date: Wed, 6 Jan 2016 16:05:37 -0700 Subject: [PATCH] improved test scripts --- test.scrp | 23 +++++++++-------------- test.sh | 26 ++++++++++++++++++-------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/test.scrp b/test.scrp index a3f1901..41e16cb 100644 --- a/test.scrp +++ b/test.scrp @@ -12,7 +12,6 @@ on run argv set theMachine to (make new AppleIIe) tell theMachine set speaker volume to 0.25 - #insert my_path & "test.dsk" into device "S6D1" insert my_path & my_test into device "S6D1" -- Now wait for the startup screen delay 0.5 @@ -27,19 +26,15 @@ on run argv -- Set the speed to maximum, to go quickly through the startup phase. set speed to maximum - -- with timeout of 180 seconds - -- waiting until the last word of the last line of the compact screen text = "REBOOT" - -- end timeout - - -- with timeout of 180 seconds - -- waiting until the last line of the compact screen text = "DONE. PRESS [RETURN] TO REBOOT." - -- end timeout - - -- use timeout code - - repeat until the last line of the compact screen text = "DONE. PRESS [RETURN] TO REBOOT." - delay 0.5 - end repeat + try + with timeout of 5 seconds + repeat until the last line of the compact screen text = "DONE. PRESS [RETURN] TO REBOOT." + delay 0.5 + end repeat + end timeout + on error + do shell script "echo timeout" + end try -- short test of image, not necessary, next 3 lines can be removed -- delay 0.5 diff --git a/test.sh b/test.sh index cb01b46..de0c47a 100755 --- a/test.sh +++ b/test.sh @@ -8,7 +8,7 @@ dsk_test() dd if=/dev/zero of=test.$FILETYPE bs=1k count=140 >/dev/null 2>&1 - ./c2t-96h ${BASENAME} test.aif + #./c2t-96h ${BASENAME} test.aif osascript test.scrp test.${FILETYPE} @@ -25,15 +25,25 @@ dsk_test() return 1 } +PATH=~/wine/bin:$PATH + +CMD=("./c2t-96h" "wine windows/c2t-96h") + for i in zork.dsk dangerous_dave.po do - if dsk_test $i - then - echo "$i passed" - else - echo "$i failed" - exit 1 - fi + for j in $(seq 0 $(( ${#CMD[@]} - 1 )) ) + do + echo ${CMD[$j]} $i test.aif + eval ${CMD[$j]} $i test.aif + if dsk_test $i + then + echo "$i passed" + echo + else + echo "$i failed" + exit 1 + fi + done done exit 0