diff --git a/Makefile b/Makefile index 8b8e566..7e8df3b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ +EMUTEST = 1 WIN32GCC = /usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/bin/i586-mingw32-gcc all: bin/c2d bin/text2page bin/page2text @@ -36,5 +37,5 @@ gameserverclient.text: Makefile figlet -c -w 40 -f slant "Game Server Online Client" >$@ test: gameserverclient gameserverclient.mon gameserverclient.text dist - ./test.sh + EMU=$(EMUTEST) ./test.sh diff --git a/gameserverclient.tiff b/gameserverclient.tiff new file mode 100644 index 0000000..d80a584 Binary files /dev/null and b/gameserverclient.tiff differ diff --git a/gameserverclientsplash.tiff b/gameserverclientsplash.tiff new file mode 100644 index 0000000..8919f7b Binary files /dev/null and b/gameserverclientsplash.tiff differ diff --git a/test.scrp b/test.scrp new file mode 100644 index 0000000..2248dd1 --- /dev/null +++ b/test.scrp @@ -0,0 +1,51 @@ +on run argv + + set my_path to (system attribute "PWD") & "/" + set my_disk to item 1 of argv + set my_done1 to item 2 of argv + set my_done2 to item 3 of argv + set my_timeout1 to item 4 of argv + set my_timeout2 to item 5 of argv + + tell application "Virtual ][" + activate + delay 1.5 + -- Close all open machines + close every machine saving no + -- Create a new (AppleIIe) + set theMachine to (make new AppleIIe) + tell theMachine + -- Change to a color screen + -- set monochrome screen to false + set scanlines to true + set speaker volume to 0.25 + insert my_path & my_disk into device "S6D1" + -- Now wait for the startup screen + -- delay 0.5 + + try + with timeout of my_timeout1 seconds + waiting until screen equals imagefile POSIX path of (my_path & my_done1) + end timeout + on error + return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done1 + end try + + try + with timeout of my_timeout2 seconds + waiting until screen equals imagefile POSIX path of (my_path & my_done2) + end timeout + on error + return "ERROR: TIMEOUT: Virtual ][ screen != " & my_done2 + end try + + -- short test of image, not necessary, next 3 lines can be removed + -- delay 1 + + end tell + -- delay 1.5 + close every machine saving no + quit + end tell +end run + diff --git a/test.sh b/test.sh index 8627ec5..5aa4d80 100755 --- a/test.sh +++ b/test.sh @@ -22,6 +22,25 @@ else exit 1 fi +if ((EMU == 1)) +then + echo + echo -n "Emulator Test..." + if ! OUTPUT=$(osascript test.scrp gameserverclient.dsk gameserverclient.tiff gameserverclient.tiff 15 15) + then + echo FAILED + exit 1 + fi + if echo $OUTPUT | grep ERROR >/dev/null 2>&1 + then + echo FAILED + echo $OUTPUT + echo + exit 1 + fi + echo PASSED +fi + rm -f ${BIN}.dsk echo echo "Testing Windows c2d..." @@ -57,6 +76,25 @@ else exit 1 fi +if ((EMU == 1)) +then + echo + echo -n "Emulator Test..." + if ! OUTPUT=$(osascript test.scrp gameserverclient.dsk gameserverclientsplash.tiff gameserverclient.tiff 15 15) + then + echo FAILED + exit 1 + fi + if echo $OUTPUT | grep ERROR >/dev/null 2>&1 + then + echo FAILED + echo $OUTPUT + echo + exit 1 + fi + echo PASSED +fi + rm -f ${BIN}.dsk echo echo "Testing Windows c2d textpage..."