c2t/tests/test.scrp

72 lines
1.6 KiB
Plaintext
Raw Normal View History

on run argv
set my_path to (system attribute "PWD") & "/"
set my_test to item 1 of argv
2016-01-07 17:10:09 +00:00
set my_done to item 2 of argv
2016-01-08 22:54:46 +00:00
set my_machine to item 3 of argv
set dsk to item 4 of argv
set loadcmd to item 5 of argv
set my_timeout to item 6 of argv
tell application "Virtual ]["
activate
delay 1.5
-- Close all open machines
close every machine saving no
2016-01-07 17:10:09 +00:00
-- Create a new (AppleIIe, AppleIIPlus, AppleII)
2016-01-08 22:54:46 +00:00
if my_machine = "iie" then
set theMachine to (make new AppleIIe)
end if
if my_machine = "iip" then
set theMachine to (make new AppleIIPlus)
end if
if my_machine = "ii" then
set theMachine to (make new AppleII)
end if
tell theMachine
2016-01-07 02:35:27 +00:00
-- Change to a color screen
-- set monochrome screen to false
2016-01-09 03:00:53 +00:00
set scanlines to true
set speaker volume to 0.25
2016-01-08 22:54:46 +00:00
if dsk = "1" then
insert my_path & my_test into device "S6D1"
end if
-- Now wait for the startup screen
delay 0.5
reset
2016-01-08 22:54:46 +00:00
set my_prompt to "*"
if loadcmd = "LOAD" then
set my_prompt to "]"
end if
2016-01-08 22:54:46 +00:00
repeat until the last line of the compact screen text = my_prompt
delay 0.5
end repeat
2016-01-08 22:54:46 +00:00
type line loadcmd
play my_path & "test.aif" on device "cassette recorder"
set speed to maximum
2016-01-06 23:05:37 +00:00
try
2016-01-08 22:54:46 +00:00
with timeout of my_timeout seconds
2016-01-07 17:10:09 +00:00
waiting until screen equals imagefile POSIX path of (my_path & my_done)
2016-01-06 23:05:37 +00:00
end timeout
on error
2016-01-07 17:10:09 +00:00
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done
2016-01-06 23:05:37 +00:00
end try
-- short test of image, not necessary, next 3 lines can be removed
-- delay 0.5
-- type line ""
-- delay 3
end tell
delay 1.5
close every machine saving no
quit
end tell
end run
2016-01-08 22:54:46 +00:00