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

This commit is contained in:
copy 2017-05-01 13:34:58 -05:00
parent 2bbae50861
commit bf7590f0cd
5 changed files with 32 additions and 7 deletions

6
.travis-run-integration.sh Executable file
View file

@ -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
.travis-run-unit.sh Executable file
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);