minor test clean up

This commit is contained in:
Egan Ford 2016-01-07 10:10:09 -07:00
parent ca16f8b782
commit 9d3f517423
4 changed files with 22 additions and 8 deletions

BIN
dskappleiiplus.tiff Normal file

Binary file not shown.

View File

@ -2,13 +2,15 @@ on run argv
set my_path to (system attribute "PWD") & "/" set my_path to (system attribute "PWD") & "/"
set my_test to item 1 of argv set my_test to item 1 of argv
set my_done to item 2 of argv
tell application "Virtual ][" tell application "Virtual ]["
activate activate
delay 0.5 delay 0.5
-- Close all open machines -- Close all open machines
close every machine saving no 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) set theMachine to (make new AppleIIe)
tell theMachine tell theMachine
-- Change to a color screen -- Change to a color screen
@ -28,14 +30,14 @@ on run argv
set speed to maximum set speed to maximum
try 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." -- repeat until the last line of the compact screen text = "DONE. PRESS [RETURN] TO REBOOT."
-- delay 0.5 -- delay 0.5
-- end repeat -- 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 end timeout
on error on error
return "\nIMAGE WRITE TIMEOUT!!! Check Virtual ][ screen. Test aborted.\n\n" return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done
end try end try
-- short test of image, not necessary, next 3 lines can be removed -- short test of image, not necessary, next 3 lines can be removed
@ -44,8 +46,8 @@ on run argv
-- delay 3 -- delay 3
end tell end tell
delay 0.5
close every machine saving no close every machine saving no
delay 0.25
quit quit
end tell end tell
end run end run

18
test.sh
View File

@ -10,15 +10,27 @@ CMD=("./c2t-96h" "wine c2t-96h.exe")
# Disks (and paths to disks) cannot have spaces in names. # Disks (and paths to disks) cannot have spaces in names.
IMAGES="disks/zork.dsk disks/dangerous_dave.po" IMAGES="disks/zork.dsk disks/dangerous_dave.po"
dsk_test() _test()
{ {
IMAGE=$1 IMAGE=$1
DONE=$2
BASENAME=$(basename $1) BASENAME=$(basename $1)
FILETYPE=$(echo $BASENAME | awk -F. '{print $NF}') FILETYPE=$(echo $BASENAME | awk -F. '{print $NF}')
dd if=/dev/zero of=test.$FILETYPE bs=1k count=140 >/dev/null 2>&1 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}') S1=$(md5sum ${IMAGE} | awk '{print $1}')
S2=$(md5sum test.$FILETYPE | awk '{print $1}') S2=$(md5sum test.$FILETYPE | awk '{print $1}')
@ -39,7 +51,7 @@ do
do do
echo ${CMD[$j]} $i test.aif echo ${CMD[$j]} $i test.aif
eval ${CMD[$j]} $i test.aif eval ${CMD[$j]} $i test.aif
if dsk_test $i if _test $i dskappleiie.tiff
then then
echo "$i passed" echo "$i passed"
echo echo