diff --git a/done.tiff b/dskappleiie.tiff similarity index 100% rename from done.tiff rename to dskappleiie.tiff diff --git a/dskappleiiplus.tiff b/dskappleiiplus.tiff new file mode 100644 index 0000000..0cbe040 Binary files /dev/null and b/dskappleiiplus.tiff differ diff --git a/test.scrp b/test.scrp index d70d59f..3c46545 100644 --- a/test.scrp +++ b/test.scrp @@ -2,13 +2,15 @@ on run argv set my_path to (system attribute "PWD") & "/" set my_test to item 1 of argv + set my_done to item 2 of argv tell application "Virtual ][" activate delay 0.5 -- Close all open machines close every machine saving no - -- Create a standard Apple //els + -- Create a new (AppleIIe, AppleIIPlus, AppleII) + -- set theMachine to (make new AppleIIPlus) set theMachine to (make new AppleIIe) tell theMachine -- Change to a color screen @@ -28,14 +30,14 @@ on run argv set speed to maximum try - with timeout of 30 seconds + with timeout of 25 seconds -- repeat until the last line of the compact screen text = "DONE. PRESS [RETURN] TO REBOOT." -- delay 0.5 -- end repeat - waiting until screen equals imagefile POSIX path of (my_path & "done.tiff") + waiting until screen equals imagefile POSIX path of (my_path & my_done) end timeout on error - return "\nIMAGE WRITE TIMEOUT!!! Check Virtual ][ screen. Test aborted.\n\n" + return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done end try -- short test of image, not necessary, next 3 lines can be removed @@ -44,8 +46,8 @@ on run argv -- delay 3 end tell + delay 0.5 close every machine saving no - delay 0.25 quit end tell end run diff --git a/test.sh b/test.sh index b573943..6e1216e 100755 --- a/test.sh +++ b/test.sh @@ -10,15 +10,27 @@ CMD=("./c2t-96h" "wine c2t-96h.exe") # Disks (and paths to disks) cannot have spaces in names. IMAGES="disks/zork.dsk disks/dangerous_dave.po" -dsk_test() +_test() { IMAGE=$1 + DONE=$2 BASENAME=$(basename $1) FILETYPE=$(echo $BASENAME | awk -F. '{print $NF}') dd if=/dev/zero of=test.$FILETYPE bs=1k count=140 >/dev/null 2>&1 - osascript test.scrp test.${FILETYPE} + if ! OUTPUT=$(osascript test.scrp test.${FILETYPE} $DONE) + then + echo + return 1 + fi + + if echo $OUTPUT | grep ERROR >/dev/null 2>&1 + then + echo $OUTPUT + echo + return 1 + fi S1=$(md5sum ${IMAGE} | awk '{print $1}') S2=$(md5sum test.$FILETYPE | awk '{print $1}') @@ -39,7 +51,7 @@ do do echo ${CMD[$j]} $i test.aif eval ${CMD[$j]} $i test.aif - if dsk_test $i + if _test $i dskappleiie.tiff then echo "$i passed" echo