diff --git a/Dockerfile.wine32 b/Dockerfile.wine32 new file mode 100644 index 0000000..38a4a05 --- /dev/null +++ b/Dockerfile.wine32 @@ -0,0 +1,12 @@ +# docker build --no-cache -t wine32 -f Dockerfile.wine32 . +FROM ubuntu:19.10 + +ENV LC_CTYPE C.UTF-8 +ENV DEBIAN_FRONTEND noninteractive + +RUN dpkg --add-architecture i386 +RUN apt-get update +RUN apt-get -qy install wine32 + +WORKDIR /root +RUN wine foobar || true diff --git a/README.md b/README.md index 8d5d7bf..6a3f8a0 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Download and extract. Both the archive and the repo `bin` directory contain OS/X 64-bit (`c2t`) and Windows 32-bit (`c2t.exe`) binaries. Just copy to any directory in your path. > OS/X users may need to adjust the permissions, e.g.: +> ``` cp bin/c2t /usr/local/bin cp bin/c2t-96h /usr/local/bin @@ -49,11 +50,11 @@ chmod 755 /usr/local/bin/c2t-96h ``` An alternative and perhaps simplier install for OS/X: + ``` sudo curl https://raw.githubusercontent.com/datajerk/c2t/master/bin/c2t-96h >/usr/local/bin/c2t-96h -sudo chmod 755 /usr/local/bin/c2t-96h sudo curl https://raw.githubusercontent.com/datajerk/c2t/master/bin/c2t >/usr/local/bin/c2t -sudo chmod 755 /usr/local/bin/c2t +sudo chmod 755 /usr/local/bin/c2t-96h /usr/local/bin/c2t ``` ## Build from Source @@ -66,24 +67,34 @@ Prerequisites: ``` git clone https://github.com/datajerk/c2t.git ``` + To build for OS/X or Linux: + ``` make clean make ``` To build from Windows, first install MinGW (), then type from the root of this distribution: + ``` PATH=C:\MinGW\bin;%PATH% gcc -Wall -Wno-unused-value -Wno-unused-function -Wno-misleading-indentation -I. -O3 -static -o c2t c2t.c ``` To cross build for Windows from OS/X, first install , then type: + ``` make clean make windows # or 'make dist' if you want both OS/X and Windows built ``` +> If MacOS errors with _cannot be opened because the developer cannot be verified_ with the mingw32 gcc binaries type: +> +``` +sudo xattr -r -d com.apple.quarantine /usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32 +``` + ## c2t-96h Version @@ -141,17 +152,26 @@ Single load binaries will auto extract and execute. Disk images will auto extra Automated testing is only supported on OS/X and requires the following: -* Virtual ][ 7.6 () +* Virtual ][ 9.2 () * Windows cross-compiling tools -* Wine () installed in `~/wine` (extract the tarball in `~/wine` and move the contents of `~/wine/usr` to `~/wine`, or change the path to `wine` in `tests/test.sh`). +* Docker Desktop for Mac () > You can edit `tests/test.md` if you do not want to test Windows binaries or want to use different images for test. +Build wine32 container: + +``` +# start docker first, make sure it is running +docker build --no-cache -t wine32 -f Dockerfile.wine32 . +``` + To test, type: + ``` make testclean # only once, unless you want to start over make test ``` + > If Virtual ][ crashes while testing, just `make test` again to restart failed test and continue where it left off. Do not type `make testclean` again unless you want to start over. Example output: diff --git a/tests/dwine b/tests/dwine new file mode 100755 index 0000000..2579ae6 --- /dev/null +++ b/tests/dwine @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run --rm -it -v $PWD/..:/pwd wine32 bash -c "cd /pwd/tests && wine $*" diff --git a/tests/test.md b/tests/test.md index 116eb54..31b087a 100644 --- a/tests/test.md +++ b/tests/test.md @@ -1,26 +1,26 @@ ## Automated Tests -| Test | Command | Input | Machine | Load | Compare | Offset | Timeout | -|:----:|-------------------------------|-------------------|---------|---------------|-------------|:------:|:-------:| -| 1 | ../bin/c2t-96h | zork.dsk | iie | LOAD | dskiie.tiff | 0 | 25 | -| 2 | ../bin/c2t-96h | dd.po | iie | LOAD | dskiie.tiff | 0 | 25 | -| 3 | ../bin/c2t-96h | zork.dsk | iip | LOAD | dskiip.tiff | 0 | 25 | -| 4 | ../bin/c2t-96h | dd.po | iip | LOAD | dskiip.tiff | 0 | 25 | -| 5 | ../bin/c2t-96h -2bcf | moon.patrol,801 | iie | LOAD | mpiie.tiff | 0 | 25 | -| 6 | ../bin/c2t-96h -2bcf | moon.patrol,801 | iip | LOAD | mpiie.tiff | 0 | 25 | -| 7 | ../bin/c2t-96h -2acf | moon.patrol,801 | ii | 800.A00R 800G | mpii.tiff | 0 | 25 | -| 8 | ../bin/c2t-96h -2bc8 | super_puckman,800 | iie | LOAD | spiie.tiff | 0 | 25 | -| 9 | ../bin/c2t-96h -2bc8 | super_puckman,800 | iip | LOAD | spiie.tiff | 0 | 25 | -| 10 | ../bin/c2t-96h -2ac8 | super_puckman,800 | ii | 800.A00R 800G | spiie.tiff | 0 | 25 | -| 11 | wine ../bin/c2t-96h.exe | zork.dsk | iie | LOAD | dskiie.tiff | 0 | 25 | -| 12 | wine ../bin/c2t-96h.exe | dd.po | iie | LOAD | dskiie.tiff | 0 | 25 | -| 13 | wine ../bin/c2t-96h.exe | zork.dsk | iip | LOAD | dskiip.tiff | 0 | 25 | -| 14 | wine ../bin/c2t-96h.exe | dd.po | iip | LOAD | dskiip.tiff | 0 | 25 | -| 15 | wine ../bin/c2t-96h.exe -2bcf | moon.patrol,801 | iie | LOAD | mpiie.tiff | 0 | 25 | -| 16 | wine ../bin/c2t-96h.exe -2bcf | moon.patrol,801 | iip | LOAD | mpiie.tiff | 0 | 25 | -| 17 | wine ../bin/c2t-96h.exe -2acf | moon.patrol,801 | ii | 800.A00R 800G | mpii.tiff | 0 | 25 | -| 18 | wine ../bin/c2t-96h.exe -2bc8 | super_puckman,800 | iie | LOAD | spiie.tiff | 0 | 25 | -| 19 | wine ../bin/c2t-96h.exe -2bc8 | super_puckman,800 | iip | LOAD | spiie.tiff | 0 | 25 | -| 20 | wine ../bin/c2t-96h.exe -2ac8 | super_puckman,800 | ii | 800.A00R 800G | spiie.tiff | 0 | 25 | +| Test | Command | Input | Machine | Load | Compare | Offset | Timeout | +|:----:|--------------------------------|-------------------|---------|---------------|-------------|:------:|:-------:| +| 1 | ../bin/c2t-96h | zork.dsk | iie | LOAD | dskiie.tiff | 0 | 25 | +| 2 | ../bin/c2t-96h | dd.po | iie | LOAD | dskiie.tiff | 0 | 25 | +| 3 | ../bin/c2t-96h | zork.dsk | iip | LOAD | dskiip.tiff | 0 | 25 | +| 4 | ../bin/c2t-96h | dd.po | iip | LOAD | dskiip.tiff | 0 | 25 | +| 5 | ../bin/c2t-96h -2bcf | moon.patrol,801 | iie | LOAD | mpiie.tiff | 0 | 25 | +| 6 | ../bin/c2t-96h -2bcf | moon.patrol,801 | iip | LOAD | mpiie.tiff | 0 | 25 | +| 7 | ../bin/c2t-96h -2acf | moon.patrol,801 | ii | 800.A00R 800G | mpii.tiff | 0 | 25 | +| 8 | ../bin/c2t-96h -2bc8 | super_puckman,800 | iie | LOAD | spiie.tiff | 0 | 25 | +| 9 | ../bin/c2t-96h -2bc8 | super_puckman,800 | iip | LOAD | spiie.tiff | 0 | 25 | +| 10 | ../bin/c2t-96h -2ac8 | super_puckman,800 | ii | 800.A00R 800G | spiie.tiff | 0 | 25 | +| 11 | dwine ../bin/c2t-96h.exe | zork.dsk | iie | LOAD | dskiie.tiff | 0 | 25 | +| 12 | dwine ../bin/c2t-96h.exe | dd.po | iie | LOAD | dskiie.tiff | 0 | 25 | +| 13 | dwine ../bin/c2t-96h.exe | zork.dsk | iip | LOAD | dskiip.tiff | 0 | 25 | +| 14 | dwine ../bin/c2t-96h.exe | dd.po | iip | LOAD | dskiip.tiff | 0 | 25 | +| 15 | dwine ../bin/c2t-96h.exe -2bcf | moon.patrol,801 | iie | LOAD | mpiie.tiff | 0 | 25 | +| 16 | dwine ../bin/c2t-96h.exe -2bcf | moon.patrol,801 | iip | LOAD | mpiie.tiff | 0 | 25 | +| 17 | dwine ../bin/c2t-96h.exe -2acf | moon.patrol,801 | ii | 800.A00R 800G | mpii.tiff | 0 | 25 | +| 18 | dwine ../bin/c2t-96h.exe -2bc8 | super_puckman,800 | iie | LOAD | spiie.tiff | 0 | 25 | +| 19 | dwine ../bin/c2t-96h.exe -2bc8 | super_puckman,800 | iip | LOAD | spiie.tiff | 0 | 25 | +| 20 | dwine ../bin/c2t-96h.exe -2ac8 | super_puckman,800 | ii | 800.A00R 800G | spiie.tiff | 0 | 25 | ### Future Edit Instructions Here diff --git a/tests/test.scrp b/tests/test.scrp index 0461540..9f0061d 100644 --- a/tests/test.scrp +++ b/tests/test.scrp @@ -8,8 +8,8 @@ on run argv set loadcmd to item 5 of argv set my_timeout to item 6 of argv - -- tell application "Virtual ][" - tell application "/Applications/Virtual ][/7.6/Virtual ][.app" + tell application "Virtual ][" + -- tell application "/Applications/Virtual ][/7.6/Virtual ][.app" activate delay 1.5 -- Close all open machines @@ -26,7 +26,7 @@ on run argv end if tell theMachine -- Change to a color screen - -- set monochrome screen to false + set monochrome screen to false set scanlines to true set speaker volume to 0.25 if dsk = "1" then diff --git a/tests/test.sh b/tests/test.sh index 68059a7..c58d769 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,7 +1,7 @@ #!/bin/bash # Path to wine binary for testing Windows binary -PATH=~/wine/bin:$PATH +PATH=.:$PATH TESTS=$1 IMAGES=images diff --git a/tests/tiffs/dskiie.tiff b/tests/tiffs/dskiie.tiff index 4d30e02..8780043 100644 Binary files a/tests/tiffs/dskiie.tiff and b/tests/tiffs/dskiie.tiff differ diff --git a/tests/tiffs/dskiip.tiff b/tests/tiffs/dskiip.tiff index 0cbe040..aa1f233 100644 Binary files a/tests/tiffs/dskiip.tiff and b/tests/tiffs/dskiip.tiff differ diff --git a/tests/tiffs/mpii.tiff b/tests/tiffs/mpii.tiff index 11fc930..cb44983 100644 Binary files a/tests/tiffs/mpii.tiff and b/tests/tiffs/mpii.tiff differ diff --git a/tests/tiffs/mpiie.tiff b/tests/tiffs/mpiie.tiff index 11fc930..cb44983 100644 Binary files a/tests/tiffs/mpiie.tiff and b/tests/tiffs/mpiie.tiff differ diff --git a/tests/tiffs/spiie.tiff b/tests/tiffs/spiie.tiff index 7c314c7..51e3500 100644 Binary files a/tests/tiffs/spiie.tiff and b/tests/tiffs/spiie.tiff differ