Skip to content

Commit 91f2a65

Browse files
Tests: Add VEDRIVE support
Thanks to @bobbimanners and @ksherlock and of course @ADTPro for making this possible.
1 parent ec3c455 commit 91f2a65

File tree

4 files changed

+125
-0
lines changed

4 files changed

+125
-0
lines changed

bin/mametest

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,35 @@ DISKARGS="$NEWDISKARGS"
126126
export UNFORMATTED_IMG="$TMPDIR/disks/unformatted.2mg"
127127
cp "res/unformatted.2mg" "$UNFORMATTED_IMG"
128128

129+
# --------------------------------------------------
130+
# VEDrive
131+
132+
# From https://github.com/bobbimanners/ProDOS-Utils/
133+
134+
VESERVER="../ProDOS-Utils/veserver.py"
135+
VESERVERARGS=""
136+
if [ -n "$VEDISK1" ]; then
137+
ext="${VEDISK1##*.}"
138+
target="$TMPDIR/disks/vdisk1.${ext}"
139+
cp "$VEDISK1" "$target"
140+
VESERVERARGS="$VESERVERARGS --disk1=$target"
141+
fi
142+
if [ -n "$VEDISK2" ]; then
143+
ext="${VEDISK2##*.}"
144+
target="$TMPDIR/disks/vdisk2.${ext}"
145+
cp "$VEDISK2" "$target"
146+
VESERVERARGS="$VESERVERARGS --disk2=$target"
147+
fi
148+
if [ -n "$VESERVERARGS" ]; then
149+
if [ ! -x "$VESERVER" ]; then
150+
echo "$VESERVER not found!" 1>&2
151+
exit 1
152+
fi
153+
../ProDOS-Utils/veserver.py $VESERVERARGS >/dev/null &
154+
VESERVER_PID=$!
155+
trap "kill $VESERVER_PID" EXIT
156+
fi
157+
129158
# --------------------------------------------------
130159
# Symbols
131160

res/tests.hdv

0 Bytes
Binary file not shown.

tests/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@ RESOLUTION="560x384"
7777
================================================== ENDCONFIG ]]
7878
```
7979

80+
## ADTPro VEDrive
81+
82+
Tests using ADTPro's Virtual Ethernet Drive are supported if you're using Ample's MAME.
83+
84+
* Have https://github.com/bobbimanners/ProDOS-Utils/ cloned parallel to your `a2d` repo
85+
* Specify an `uthernet2` card in the test config; works in Slot 3 with `-sl3`
86+
* Define `VEDISK1` and `VEDISK2` in the test config, pointing at .po, .hdv or .2mg disk images.
87+
88+
If you get a warning from Ample/MAME about VMNet Permissions, follow the instructions.
89+
90+
See `tests/infrastructure/vedrive.lua` for an example.
91+
92+
8093
# Files
8194

8295
## `lib/` - Libraries

tests/infrastructure/vedrive.lua

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
--[[ BEGINCONFIG ========================================
2+
3+
MODEL="apple2ee"
4+
MODELARGS="-sl1 ramfactor -sl2 mouse -sl3 uthernet2 -sl7 cffa2 -aux ext80"
5+
DISKARGS="-hard1 $HARDIMG -hard2 res/tests.hdv"
6+
VEDISK1=res/floppy_with_files.2mg
7+
VEDISK2=res/disk_b.2mg
8+
9+
======================================== ENDCONFIG ]]
10+
11+
a2d.ConfigureRepaintTime(0.25)
12+
13+
test.Step(
14+
"VEDRIVE",
15+
function()
16+
a2d.OpenPath("/A2.DESKTOP/EXTRAS/BASIC.SYSTEM")
17+
apple2.WaitForBasicSystem()
18+
apple2.TypeLine("PREFIX /TESTS/DRIVERS")
19+
emu.wait(10)
20+
21+
--------------------------------------------------
22+
-- Configure VEDrive
23+
--------------------------------------------------
24+
25+
apple2.TypeLine("-VEDRIVE.SETUP")
26+
27+
util.WaitFor(
28+
"IP prompt", function()
29+
return apple2.GrabTextScreen():match("PLEASE ENTER THE ADTPRO SERVER ADDRESS:")
30+
end)
31+
apple2.TypeLine("192.168.64.1")
32+
33+
util.WaitFor(
34+
"audible feedback prompt", function()
35+
return apple2.GrabTextScreen():match("AUDIO FEEDBACK IF AVAILABLE%?")
36+
end)
37+
apple2.LeftArrowKey()
38+
apple2.TypeLine("0")
39+
40+
util.WaitFor(
41+
"visual feedback prompt", function()
42+
return apple2.GrabTextScreen():match("VISUAL FEEDBACK IF AVAILABLE%?")
43+
end)
44+
apple2.LeftArrowKey()
45+
apple2.TypeLine("0")
46+
47+
apple2.Type("_")
48+
util.WaitFor(
49+
"prompt", function()
50+
return apple2.GrabTextScreen():match("]_")
51+
end)
52+
apple2.LeftArrowKey()
53+
54+
--------------------------------------------------
55+
-- Launch VEDrive
56+
--------------------------------------------------
57+
58+
apple2.TypeLine("-VEDRIVE")
59+
util.WaitFor(
60+
"confirmation", function()
61+
return apple2.GrabTextScreen():match("Add VEDrive")
62+
end)
63+
64+
apple2.TypeLine("BYE")
65+
a2d.WaitForDesktopReady()
66+
67+
--------------------------------------------------
68+
-- Launch VEDrive
69+
--------------------------------------------------
70+
a2d.CloseAllWindows()
71+
a2d.ClearSelection()
72+
emu.wait(5)
73+
test.Snap("verify VEDrives have File Share icons")
74+
75+
a2d.OpenPath("WITH.FILES")
76+
test.Snap("verify files present")
77+
a2d.CloseAllWindows()
78+
a2d.ClearSelection()
79+
80+
a2d.InvokeMenuItem(a2d.SPECIAL_MENU, a2d.SPECIAL_FORMAT_DISK-2)
81+
emu.wait(10)
82+
test.Snap("verify VEDrives listed")
83+
end)

0 commit comments

Comments
 (0)