commit 23e9889a509b0e8f103cc3b4d3f833607aeffbf8
parent 5e6f566671b638091d97b9b0aa656063fc2c785e
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Tue, 3 Jul 2018 19:16:28 +0200
Added two more tests: running under dosbox and as a shell script
Diffstat:
12 files changed, 212 insertions(+), 3 deletions(-)
diff --git a/.travis.yml b/.travis.yml
@@ -49,6 +49,14 @@ matrix:
apt:
packages:
- bochs-sdl
+ - env: MODE=gui-sh
+ sudo: false
+ - env: MODE=dosbox
+ sudo: false
+ addons:
+ apt:
+ packages:
+ - dosbox
- env: MODE=self-test # Ensure that the Makefile works, especially with parallel builds.
script: (cd example-os && make -j 10)
sudo: true
diff --git a/README.md b/README.md
@@ -15,3 +15,11 @@ Below are screenshots of an example operating system. This example merely displa
## Bochs

+
+## DOSBox (.bat)
+
+
+
+## Unix graphical environment (.sh)
+
+
diff --git a/example-os/Makefile b/example-os/Makefile
@@ -1,5 +1,5 @@
os_filename = os.bat
-tests = test/qemu-system-i386 test/qemu-system-arm test/virtualbox test/bochs
+tests = test/qemu-system-i386 test/qemu-system-arm test/virtualbox test/bochs test/gui-sh test/dosbox
.PHONY: all
all: $(os_filename) os.ndisasm.disasm os.reasm.asm os.reasm .gitignore test Makefile
diff --git a/example-os/os.asm b/example-os/os.asm
@@ -50,14 +50,19 @@ db 0xaa
;; end of the bootsector, close the sh here-document skipped via : <<'EOF'
db `\n`
db `EOF\n`
-db `echo Hello world from sh!\n`
+db `echo Hello world by the OS, from sh!\n`
db `while sleep 10; do :; done\n`
db `exit\n`
+;; for good measure: go into an infinite loop if the exit did not happen.
+db `while :; do sleep 1; done\n`
;; end of the SH section, everything until this point is skipped by MS-DOS batch due to the GOTO'
db `:msdos\n`
db `@cls\n`
-db `@echo "hello world" from MS-DOS\n`
+db `@echo Hello world by the OS, from MS-DOS!\n`
+db `command.com\n`
+db `exit\n`
+;; for good measure: go into an infinite loop if the exit did not happen.
db `:loop\n`
db `GOTO loop\n`
diff --git a/test/check-dosbox.sikuli/1530637967171.png b/test/check-dosbox.sikuli/1530637967171.png
Binary files differ.
diff --git a/test/check-dosbox.sikuli/check-dosbox.html b/test/check-dosbox.sikuli/check-dosbox.html
@@ -0,0 +1,76 @@
+
+<html>
+ <head>
+ <style type="text/css">
+ .sikuli-code {
+ font-size: 20px;
+ font-family: "Osaka-mono", Monospace;
+ line-height: 1.5em;
+ display:table-cell;
+ white-space: pre-wrap; /* css-3 */
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+ width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
+ }
+ .sikuli-code img {
+ vertical-align: middle;
+ margin: 2px;
+ border: 1px solid #ccc;
+ padding: 2px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-box-shadow: 1px 1px 1px gray;
+ -webkit-box-shadow: 1px 1px 2px gray;
+ }
+ .kw {
+ color: blue;
+ }
+ .skw {
+ color: rgb(63, 127, 127);
+ }
+
+ .str {
+ color: rgb(128, 0, 0);
+ }
+
+ .dig {
+ color: rgb(128, 64, 0);
+ }
+
+ .cmt {
+ color: rgb(200, 0, 200);
+ }
+
+ h2 {
+ display: inline;
+ font-weight: normal;
+ }
+
+ .info {
+ border-bottom: 1px solid #ddd;
+ padding-bottom: 5px;
+ margin-bottom: 20px;
+ display: none;
+ }
+
+ a {
+ color: #9D2900;
+ }
+
+ body {
+ font-family: "Trebuchet MS", Arial, Sans-Serif;
+ }
+
+ </style>
+ </head>
+<body>
+<div class="info">
+<h2>check-dosbox.sikuli</h2> <a href="check-dosbox.zip">(Download this script)</a>
+</div>
+<pre class="sikuli-code">
+<span class="skw">wait</span>(<img src="1530637967171.png" />, <span class="dig">10</span>)
+</pre>
+</body>
+</html>
diff --git a/test/check-dosbox.sikuli/check-dosbox.py b/test/check-dosbox.sikuli/check-dosbox.py
@@ -0,0 +1 @@
+wait("1530637967171.png", 10)
diff --git a/test/check-gui-sh.sikuli/1530638293676.png b/test/check-gui-sh.sikuli/1530638293676.png
Binary files differ.
diff --git a/test/check-gui-sh.sikuli/check-gui-sh.html b/test/check-gui-sh.sikuli/check-gui-sh.html
@@ -0,0 +1,76 @@
+
+<html>
+ <head>
+ <style type="text/css">
+ .sikuli-code {
+ font-size: 20px;
+ font-family: "Osaka-mono", Monospace;
+ line-height: 1.5em;
+ display:table-cell;
+ white-space: pre-wrap; /* css-3 */
+ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+ width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
+ }
+ .sikuli-code img {
+ vertical-align: middle;
+ margin: 2px;
+ border: 1px solid #ccc;
+ padding: 2px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-box-shadow: 1px 1px 1px gray;
+ -webkit-box-shadow: 1px 1px 2px gray;
+ }
+ .kw {
+ color: blue;
+ }
+ .skw {
+ color: rgb(63, 127, 127);
+ }
+
+ .str {
+ color: rgb(128, 0, 0);
+ }
+
+ .dig {
+ color: rgb(128, 64, 0);
+ }
+
+ .cmt {
+ color: rgb(200, 0, 200);
+ }
+
+ h2 {
+ display: inline;
+ font-weight: normal;
+ }
+
+ .info {
+ border-bottom: 1px solid #ddd;
+ padding-bottom: 5px;
+ margin-bottom: 20px;
+ display: none;
+ }
+
+ a {
+ color: #9D2900;
+ }
+
+ body {
+ font-family: "Trebuchet MS", Arial, Sans-Serif;
+ }
+
+ </style>
+ </head>
+<body>
+<div class="info">
+<h2>check-gui-sh.sikuli</h2> <a href="check-gui-sh.zip">(Download this script)</a>
+</div>
+<pre class="sikuli-code">
+<span class="skw">wait</span>(<img src="1530638293676.png" />, <span class="dig">10</span>)
+</pre>
+</body>
+</html>
diff --git a/test/check-gui-sh.sikuli/check-gui-sh.py b/test/check-gui-sh.sikuli/check-gui-sh.py
@@ -0,0 +1 @@
+wait("1530638293676.png", 10)
diff --git a/test/dosbox.sh b/test/dosbox.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+if test $# -ne 1 || test "$1" = '-h' -o "$1" = '--help'; then
+ echo "Usage: $0 operating_system_file"
+fi
+os_filename="$1"
+
+dosbox ${os_filename} &
+pid=$!
+runsikulix -r test/check-dosbox.sikuli && exitcode=$? || exitcode=$?
+
+./utils/take-screenshots.sh "./deploy-screenshots/$(basename "$0" .sh).png"
+
+kill $pid
+
+exit $exitcode
diff --git a/test/gui-sh.sh b/test/gui-sh.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+if test $# -ne 1 || test "$1" = '-h' -o "$1" = '--help'; then
+ echo "Usage: $0 operating_system_file"
+fi
+os_filename="$1"
+
+xterm -e ${os_filename} &
+pid=$!
+runsikulix -r test/check-gui-sh.sikuli && exitcode=$? || exitcode=$?
+
+./utils/take-screenshots.sh "./deploy-screenshots/$(basename "$0" .sh).png"
+
+kill $pid
+
+exit $exitcode