Skip to content

Commit

Permalink
Add kvm-unit-test to travis CI (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
copy committed May 1, 2017
1 parent 2bbae50 commit bf7590f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .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 changes: 5 additions & 0 deletions .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
12 changes: 5 additions & 7 deletions .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 changes: 3 additions & 0 deletions tests/kvm-unit-tests/README.md
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions tests/kvm-unit-tests/run.js
Expand Up @@ -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);
Expand Down

0 comments on commit bf7590f

Please sign in to comment.