From 23e9889a509b0e8f103cc3b4d3f833607aeffbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Tue, 3 Jul 2018 19:16:28 +0200 Subject: [PATCH] Added two more tests: running under dosbox and as a shell script --- .travis.yml | 8 +++ README.md | 8 +++ example-os/Makefile | 2 +- example-os/os.asm | 9 ++- test/check-dosbox.sikuli/1530637967171.png | Bin 0 -> 526 bytes test/check-dosbox.sikuli/check-dosbox.html | 76 +++++++++++++++++++++ test/check-dosbox.sikuli/check-dosbox.py | 1 + test/check-gui-sh.sikuli/1530638293676.png | Bin 0 -> 432 bytes test/check-gui-sh.sikuli/check-gui-sh.html | 76 +++++++++++++++++++++ test/check-gui-sh.sikuli/check-gui-sh.py | 1 + test/dosbox.sh | 17 +++++ test/gui-sh.sh | 17 +++++ 12 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 test/check-dosbox.sikuli/1530637967171.png create mode 100644 test/check-dosbox.sikuli/check-dosbox.html create mode 100644 test/check-dosbox.sikuli/check-dosbox.py create mode 100644 test/check-gui-sh.sikuli/1530638293676.png create mode 100644 test/check-gui-sh.sikuli/check-gui-sh.html create mode 100644 test/check-gui-sh.sikuli/check-gui-sh.py create mode 100755 test/dosbox.sh create mode 100755 test/gui-sh.sh diff --git a/.travis.yml b/.travis.yml index de93d90..2b4080f 100644 --- 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 index 9d6096e..b477ee4 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,11 @@ Below are screenshots of an example operating system. This example merely displa ## Bochs ![Latest screenshot of the operating system running in Bochs](https://raw.githubusercontent.com/jsmaniac/travis-os-deploy-artifacts/screenshots-bochs/bochs.png) + +## DOSBox (.bat) + +![Latest screenshot of the operating system running in dosbox](https://raw.githubusercontent.com/jsmaniac/travis-os-deploy-artifacts/screenshots-dosbox/dosbox.png) + +## Unix graphical environment (.sh) + +![Latest screenshot of the operating system running in gui-sh](https://raw.githubusercontent.com/jsmaniac/travis-os-deploy-artifacts/screenshots-gui-sh/gui-sh.png) diff --git a/example-os/Makefile b/example-os/Makefile index a86d869..15516ab 100644 --- 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 index 5c045e2..d02c508 100644 --- 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 new file mode 100644 index 0000000000000000000000000000000000000000..4656c624fa66a9fbb1dafed8bfe51bb0c72562c6 GIT binary patch literal 526 zcmV+p0`dKcP)m2x>S=-t2 zYJE_rJgI@jafMm3|GjoBw{PbVXEyOm)b(?*Q2tuIts1)kvR2m0+TBB(pS7E6SsSSz zSqq$$wY4?0_!?a>jrwbb@88DbExTYo?0i$15$xY<_12lX9W+n~uEFj#Up8wC=atIZ z$S6(L0#oybNR|Y%ww6h$sO$H?!|;yx(UG;sa$LO}VzS=$VsFWHGE@HH40Txfo#bAd zwJmVJUk3tA&1;7p;?=S?I3_4e_zHb=ZEBdR|5UXviHAsw$Jb_qBc9aYsb6p9cJyo% zaBS92_PjG$yO}zL$h>vd&bQ;jgh=i4%&ct(+^?+_13=b(W7d}M1zbF9Kl^MHz#&_%2 z^>)xZ8M0SGi#<2qCf1O>%L3r5hb)Q>01^uT?vSruXaE2J00000000;D1I9)dOx=`c Qxc~qF07*qoM6N<$f-nvL!2kdN literal 0 HcmV?d00001 diff --git a/test/check-dosbox.sikuli/check-dosbox.html b/test/check-dosbox.sikuli/check-dosbox.html new file mode 100644 index 0000000..6d5d929 --- /dev/null +++ b/test/check-dosbox.sikuli/check-dosbox.html @@ -0,0 +1,76 @@ + + + + + + +
+

check-dosbox.sikuli

(Download this script) +
+
+wait(, 10)
+
+ + diff --git a/test/check-dosbox.sikuli/check-dosbox.py b/test/check-dosbox.sikuli/check-dosbox.py new file mode 100644 index 0000000..6029d00 --- /dev/null +++ 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 new file mode 100644 index 0000000000000000000000000000000000000000..86d20e685e1cdfe07012ffc358406fe7c6733735 GIT binary patch literal 432 zcmV;h0Z;ykP)k5bzGqhH5cCLZGczFN0; z?E1_xzdk+Ra{ld)9ptGa2{f0t_}i7A$z|ouPcSE6jIGaVT{oCl-pKJhA6HMM9U~8nn(Msf zX0K4k`%Hp%m>WXLZokqqdJ|~Tj zPkddabyXc0U*4O)&(EugsDbi+MSNHO>m5KfN2&y%ya37zfbs$;F96C5pu7MmFM#p_ a+};nyD%&AkR~KCX0000 + + + + +
+

check-gui-sh.sikuli

(Download this script) +
+
+wait(, 10)
+
+ + diff --git a/test/check-gui-sh.sikuli/check-gui-sh.py b/test/check-gui-sh.sikuli/check-gui-sh.py new file mode 100644 index 0000000..2687747 --- /dev/null +++ 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 new file mode 100755 index 0000000..9f5571d --- /dev/null +++ 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 new file mode 100755 index 0000000..a928da0 --- /dev/null +++ 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