Browse Source

Add test for serial large/binary files

Fabian 8 months ago
parent
commit
5664eea54a
2 changed files with 26 additions and 0 deletions
  1. 1 0
      Makefile
  2. 25 0
      tests/api/test.js

+ 1 - 0
Makefile

@@ -313,6 +313,7 @@ api-tests: all-debug
 	./tests/api/state.js
 	./tests/api/reset.js
 	./tests/api/floppy-insert-eject.js
+	./tests/api/serial.js
 
 all-tests: jshint kvm-unit-test qemutests qemutests-release jitpagingtests api-tests nasmtests nasmtests-force-jit tests expect-tests
 	# Skipping:

+ 25 - 0
tests/api/test.js

@@ -0,0 +1,25 @@
+#!/usr/bin/env node
+"use strict";
+
+const TEST_RELEASE_BUILD = +process.env.TEST_RELEASE_BUILD;
+
+const fs = require("fs");
+var V86 = require(`../../build/${TEST_RELEASE_BUILD ? "libv86" : "libv86-debug"}.js`).V86;
+
+process.on("unhandledRejection", exn => { throw exn; });
+
+const emulator = new V86({
+    bios: { url: __dirname + "/../../bios/seabios.bin" },
+    vga_bios: { url: __dirname + "/../../bios/vgabios.bin" },
+    fda: { url: __dirname + "/../../images/freedos722.img", async: true },
+    network_relay_url: "<UNUSED>",
+    autostart: true,
+    memory_size: 32 * 1024 * 1024,
+    filesystem: {},
+    log_level: -641,
+    screen_dummy: true,
+});
+
+setInterval(() => {
+    console.log(emulator.screen_adapter.get_text_screen());
+}, 500);