Browse Source

Add kvm-unit-test to travis CI (#129)

copy 7 years ago
parent
commit
bf7590f0cd
5 changed files with 32 additions and 7 deletions
  1. 6 0
      .travis-run-integration.sh
  2. 5 0
      .travis-run-unit.sh
  3. 5 7
      .travis.yml
  4. 3 0
      tests/kvm-unit-tests/README.md
  5. 13 0
      tests/kvm-unit-tests/run.js

+ 6 - 0
.travis-run-integration.sh

@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+set -e
+mkdir -p images
+(cd images && curl --compressed -OOOOOOOOOO https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img,oberon.dsk,oberon-boot.dsk})
+make build/libv86.js
+tests/full/run.js

+ 5 - 0
.travis-run-unit.sh

@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+set -e
+make build/libv86.js
+(cd tests/kvm-unit-tests && ./configure && make)
+tests/kvm-unit-tests/run.js tests/kvm-unit-tests/x86/realmode.flat

+ 5 - 7
.travis.yml

@@ -1,10 +1,8 @@
 language: node_js
 node_js:
-  - "5.0.0"
+  - "6.10.2"
 script:
-  - mkdir -p images
-  - cd images
-  - curl --compressed -OOOOOOOOOO https://copy.sh/v86/images/{linux.iso,linux3.iso,kolibri.img,windows101.img,os8.dsk,freedos722.img,openbsd.img,oberon.dsk,oberon-boot.dsk}
-  - cd ..
-  - make build/libv86.js
-  - npm test
+  - "./.travis-run-$TESTSUITE.sh"
+env:
+    - TEST_SUITE=unit
+    - TEST_SUITE=integration

+ 3 - 0
tests/kvm-unit-tests/README.md

@@ -17,6 +17,9 @@ make -C ../../build/libv86.js
 Tests can also be run in browser by going to `?profile=test-$name` (for
 example, `?profile=test-realmode`).
 
+Most tests require you to set `ENABLE_ACPI` to `true` in `src/config.js`
+(currently not the default).
+
 
 # Welcome to kvm-unit-tests
 

+ 13 - 0
tests/kvm-unit-tests/run.js

@@ -31,6 +31,19 @@ var emulator = new V86({
     memory_size: 256 * 1024 * 1024,
 });
 
+emulator.bus.register("emulator-started", function()
+{
+    emulator.v86.cpu.io.register_write_consecutive(0xF4, this,
+        function(value)
+        {
+            console.log("Test exited with code " + value);
+            process.exit(value);
+        },
+        function() {},
+        function() {},
+        function() {});
+});
+
 emulator.add_listener("serial0-output-char", function(chr)
 {
     process.stdout.write(chr);