From fcdd110cb7d1e4301463e9742a68a6ddac5f5c91 Mon Sep 17 00:00:00 2001 From: Fabian Date: Thu, 29 Aug 2024 13:52:33 +0200 Subject: [PATCH] Clean up some tests --- lib/filesystem.js | 4 +- src/browser/starter.js | 47 +++---- tests/benchmark/linux-boot.js | 2 +- tests/devices/fetch_network.js | 229 +++++++------------------------- tests/devices/virtio_9p.js | 153 +++++----------------- tests/devices/wisp_network.js | 232 +++++++-------------------------- tests/jit-paging/run.js | 2 +- tests/qemu/run.js | 1 - 8 files changed, 153 insertions(+), 517 deletions(-) diff --git a/lib/filesystem.js b/lib/filesystem.js index 38b32f4b42..46856e0116 100644 --- a/lib/filesystem.js +++ b/lib/filesystem.js @@ -162,7 +162,7 @@ FS.prototype.HandleEvent = function(id) { this.events = newevents; }; -FS.prototype.load_from_json = function(fs, done) +FS.prototype.load_from_json = function(fs) { dbg_assert(fs, "Invalid fs passed to load_from_json"); @@ -183,8 +183,6 @@ FS.prototype.load_from_json = function(fs, done) //{ // this.Check(); //} - - done && done(); }; FS.prototype.LoadRecursive = function(data, parentid) diff --git a/src/browser/starter.js b/src/browser/starter.js index eccc6950e4..1925e23c96 100644 --- a/src/browser/starter.js +++ b/src/browser/starter.js @@ -1179,10 +1179,9 @@ V86.prototype.serial_set_clear_to_send = function(serial, status) * @param {string} path Path for the mount point * @param {string|undefined} baseurl * @param {string|undefined} basefs As a JSON string - * @param {function(Object)=} callback * @export */ -V86.prototype.mount_fs = async function(path, baseurl, basefs, callback) +V86.prototype.mount_fs = async function(path, baseurl, basefs) { let file_storage = new MemoryFileStorage(); @@ -1191,39 +1190,26 @@ V86.prototype.mount_fs = async function(path, baseurl, basefs, callback) file_storage = new ServerFileStorageWrapper(file_storage, baseurl); } const newfs = new FS(file_storage, this.fs9p.qidcounter); - const mount = () => - { - const idx = this.fs9p.Mount(path, newfs); - if(!callback) - { - return; - } - if(idx === -ENOENT) - { - callback(new FileNotFoundError()); - } - else if(idx === -EEXIST) - { - callback(new FileExistsError()); - } - else if(idx < 0) - { - dbg_assert(false, "Unexpected error code: " + (-idx)); - callback(new Error("Failed to mount. Error number: " + (-idx))); - } - else - { - callback(null); - } - }; if(baseurl) { dbg_assert(typeof basefs === "object", "Filesystem: basefs must be a JSON object"); - newfs.load_from_json(basefs, () => mount()); + newfs.load_from_json(basefs); } - else + + const idx = this.fs9p.Mount(path, newfs); + + if(idx === -ENOENT) { - mount(); + throw new FileNotFoundError(); + } + else if(idx === -EEXIST) + { + throw new FileExistsError(); + } + else if(idx < 0) + { + dbg_assert(false, "Unexpected error code: " + (-idx)); + throw new Error("Failed to mount. Error number: " + (-idx)); } }; @@ -1354,7 +1340,6 @@ V86.prototype.automatically = function(steps) }; run(steps); - }; /** diff --git a/tests/benchmark/linux-boot.js b/tests/benchmark/linux-boot.js index 8586afb6ad..0fb7c1410c 100755 --- a/tests/benchmark/linux-boot.js +++ b/tests/benchmark/linux-boot.js @@ -48,7 +48,7 @@ else emulator.bus.register("emulator-started", function() { - console.error("Booting now, please stand by"); + console.log("Booting now, please stand by"); start_time = Date.now(); }); diff --git a/tests/devices/fetch_network.js b/tests/devices/fetch_network.js index 4f7d8a49c3..c3f7cf8575 100755 --- a/tests/devices/fetch_network.js +++ b/tests/devices/fetch_network.js @@ -9,28 +9,11 @@ const V86 = require(`../../build/${TEST_RELEASE_BUILD ? "libv86" : "libv86-debug const assert = require("assert").strict; const SHOW_LOGS = false; -const STOP_ON_FIRST_FAILURE = false; - -function log_pass(msg, ...args) -{ - console.log(`\x1b[92m[+] ${msg}\x1b[0m`, ...args); -} - -function log_warn(msg, ...args) -{ - console.error(`\x1b[93m[!] ${msg}\x1b[0m`, ...args); -} - -function log_fail(msg, ...args) -{ - console.error(`\x1b[91m[-] ${msg}\x1b[0m`, ...args); -} const tests = [ { name: "DHCP", - timeout: 60, start: () => { emulator.serial0_send("udhcpc\n"); @@ -44,7 +27,6 @@ const tests = }, { name: "ifconfig", - timeout: 60, start: () => { emulator.serial0_send("ifconfig\n"); @@ -58,7 +40,6 @@ const tests = }, { name: "route", - timeout: 60, start: () => { emulator.serial0_send("ip route\n"); @@ -72,7 +53,6 @@ const tests = }, { name: "ping 1.2.3.4", - timeout: 60, start: () => { emulator.serial0_send("ping -c 2 1.2.3.4\n"); @@ -86,7 +66,6 @@ const tests = }, { name: "arp -a", - timeout: 60, start: () => { emulator.serial0_send("arp -a\n"); @@ -100,7 +79,6 @@ const tests = }, { name: "Curl mocked.example.org", - timeout: 60, allow_failure: true, start: () => { @@ -115,7 +93,6 @@ const tests = }, { name: "Curl example.org", - timeout: 60, allow_failure: true, start: () => { @@ -131,10 +108,6 @@ const tests = ]; -let test_num = 0; -let test_timeout = 0; -const failed_tests = []; - const emulator = new V86({ bios: { url: __dirname + "/../../bios/seabios.bin" }, vga_bios: { url: __dirname + "/../../bios/vgabios.bin" }, @@ -162,191 +135,89 @@ emulator.add_listener("emulator-ready", function () { }; }); -let ran_command = false; +let test_num = 0; +let booted = false; let line = ""; -let capturing = false; let capture = ""; -let next_trigger; -let next_trigger_handler; - -function start_timeout() -{ - if(tests[test_num].timeout) - { - test_timeout = setTimeout(() => - { - log_fail("Test #%d (%s) took longer than %s sec. Timing out and terminating.", test_num, tests[test_num].name, tests[test_num].timeout); - process.exit(1); - }, tests[test_num].timeout * 1000); - } -} +let end_trigger; -function begin() +emulator.bus.register("emulator-started", function() { - start_timeout(); - - console.log("\nPreparing test #%d: %s", test_num, tests[test_num].name); - start_test(); -} + console.log("Booting now, please stand by"); +}); -function start_test() +emulator.add_listener("serial0-output-byte", function(byte) { - console.log("Starting test #%d: %s", test_num, tests[test_num].name); - - capture = ""; - - tests[test_num].start(); + const chr = String.fromCharCode(byte); + if(chr < " " && chr !== "\n" && chr !== "\t" || chr > "~") + { + return; + } - if(tests[test_num].capture_trigger) + let new_line = ""; + if(chr === "\n") { - next_trigger = tests[test_num].capture_trigger; - next_trigger_handler = start_capture; + console.log(" Captured: %s", line); + new_line = line; + capture += line + "\n"; + line = ""; } else { - next_trigger = tests[test_num].end_trigger; - next_trigger_handler = end_test; + line += chr; } - start_capture(); -} -function start_capture() -{ - console.log("Capturing..."); - capture = ""; - capturing = true; - - next_trigger = tests[test_num].end_trigger; - next_trigger_handler = end_test; -} - -function end_test() -{ - capturing = false; - - if(tests[test_num].timeout) + if(new_line === end_trigger) { - clearTimeout(test_timeout); - } + let test_has_failed = false; - let test_has_failed = false; - - try { - tests[test_num].end(capture); - } catch(e) { - console.log(e); - test_has_failed = true; - } + try { + tests[test_num].end(capture); + } catch(e) { + console.log(e); + test_has_failed = true; + } - if(!test_has_failed) - { - log_pass("Test #%d passed: %s", test_num, tests[test_num].name); - } - else - { - if(tests[test_num].allow_failure) + if(!test_has_failed) { - log_warn("Test #%d failed: %s (failure allowed)", test_num, tests[test_num].name); + console.log("[+] Test #%d passed: %s", test_num, tests[test_num].name); } else { - log_fail("Test #%d failed: %s", test_num, tests[test_num].name); - - if(STOP_ON_FIRST_FAILURE) + if(tests[test_num].allow_failure) + { + console.warn("[!] Test #%d failed: %s (failure allowed)", test_num, tests[test_num].name); + } + else { - finish_tests(); + console.error("[-] Test #%d failed: %s", test_num, tests[test_num].name); + process.exit(1); } } - test_has_failed = false; - } - test_num++; + test_num++; - if(test_num < tests.length) - { - begin(); - } - else - { - finish_tests(); } -} - -function finish_tests() -{ - emulator.stop(); - console.log("\nTests finished."); - if(failed_tests.length === 0) + if(!booted && line.endsWith("~% ") || new_line === end_trigger) { - console.log("All tests passed"); - } - else - { - let unallowed_failure = false; + booted = true; - console.error("Failed %d out of %d tests:", failed_tests.length, tests.length); - for(const num of failed_tests) + if(test_num >= tests.length) { - if(tests[num].allow_failure) - { - log_warn("#%d %s (failure allowed)", num, tests[num].name); - } - else - { - unallowed_failure = true; - log_fail("#%d %s", num, tests[num].name); - } + emulator.stop(); + emulator.destroy(); + + console.log("Tests finished."); } - if(unallowed_failure) + else { - process.exit(1); - } - } -} - -emulator.bus.register("emulator-started", function() -{ - console.error("Booting now, please stand by"); -}); - -emulator.add_listener("serial0-output-byte", function(byte) -{ - const chr = String.fromCharCode(byte); - if(chr < " " && chr !== "\n" && chr !== "\t" || chr > "~") - { - return; - } + console.log("Starting test #%d: %s", test_num, tests[test_num].name); - let new_line = ""; - let is_new_line = false; - if(chr === "\n") - { - is_new_line = true; - new_line = line; - line = ""; - } - else - { - line += chr; - } + capture = ""; + end_trigger = tests[test_num].end_trigger; - if(!ran_command && line.endsWith("~% ")) - { - ran_command = true; - begin(); - } - else if(new_line === next_trigger) - { - next_trigger_handler(); - } - else if(is_new_line && capturing) - { - capture += new_line + "\n"; - console.log(" Captured: %s", new_line); - } - else if(is_new_line) - { - console.log(" Serial: %s", new_line); + tests[test_num].start(); + } } }); diff --git a/tests/devices/virtio_9p.js b/tests/devices/virtio_9p.js index 44a46115f5..88bad53b90 100755 --- a/tests/devices/virtio_9p.js +++ b/tests/devices/virtio_9p.js @@ -12,28 +12,13 @@ const testfsjson = require("./testfs.json"); const SHOW_LOGS = false; const STOP_ON_FIRST_FAILURE = false; -function log_pass(msg, ...args) -{ - console.log(`\x1b[92m[+] ${msg}\x1b[0m`, ...args); -} - -function log_warn(msg, ...args) -{ - console.error(`\x1b[93m[!] ${msg}\x1b[0m`, ...args); -} - -function log_fail(msg, ...args) -{ - console.error(`\x1b[91m[-] ${msg}\x1b[0m`, ...args); -} - function assert_equal(actual, expected, message) { if(actual !== expected) { - log_warn("Failed assert equal (Test: %s). %s", tests[test_num].name, message || ""); - log_warn("Expected:\n" + expected); - log_warn("Actual:\n" + actual); + console.warn("Failed assert equal (Test: %s). %s", tests[test_num].name, message || ""); + console.warn("Expected:\n" + expected); + console.warn("Actual:\n" + actual); test_fail(); } } @@ -42,8 +27,8 @@ function assert_not_equal(actual, expected, message) { if(actual === expected) { - log_warn("Failed assert not equal (Test: %s). %s", tests[test_num].name, message || ""); - log_warn("Expected something different than:\n" + expected); + console.warn("Failed assert not equal (Test: %s). %s", tests[test_num].name, message || ""); + console.warn("Expected something different than:\n" + expected); test_fail(); } } @@ -164,7 +149,7 @@ const tests = assert_equal(data.length, 512 * 1024); if(data.find(v => v !== 0)) { - log_warn("Fail: Incorrect data. Expected all zeros."); + console.warn("Fail: Incorrect data. Expected all zeros."); test_fail(); } done(); @@ -663,7 +648,7 @@ const tests = const outputs = capture.split("\n").map(output => output.split(/\s+/)); if(outputs.length < 3) { - log_warn("Wrong format: %s", capture); + console.warn("Wrong format: %s", capture); test_fail(); done(); return; @@ -732,7 +717,7 @@ const tests = if(outputs.length < 3) { - log_warn("Wrong format (expected 3 rows): %s", capture); + console.warn("Wrong format (expected 3 rows): %s", capture); test_fail(); done(); return; @@ -1567,96 +1552,46 @@ let capture = ""; let next_trigger; let next_trigger_handler; -function start_timeout() +async function prepare_test() { + console.log("\nPreparing test #%d: %s", test_num, tests[test_num].name); + if(tests[test_num].timeout) { test_timeout = setTimeout(() => { - log_fail("Test #%d (%s) took longer than %s sec. Timing out and terminating.", test_num, tests[test_num].name, tests[test_num].timeout); + console.error("[-] Test #%d (%s) took longer than %s sec. Timing out and terminating.", test_num, tests[test_num].name, tests[test_num].timeout); process.exit(1); }, tests[test_num].timeout * 1000); } -} - -function nuke_fs() -{ - start_timeout(); - console.log("\nPreparing test #%d: %s", test_num, tests[test_num].name); console.log(" Nuking /mnt"); - emulator.fs9p.RecursiveDelete(""); - reload_fsjson(); -} -function reload_fsjson() -{ if(tests[test_num].use_fsjson) { console.log(" Reloading files from json"); - emulator.fs9p.load_from_json(testfsjson, () => do_mounts()); - } - else - { - do_mounts(); + emulator.fs9p.load_from_json(testfsjson); } -} -function do_mounts() -{ console.log(" Configuring mounts"); if(tests[test_num].mounts && tests[test_num].mounts.length > 0) { - premount(0); - - function premount(mount_num) - { - const path = tests[test_num].mounts[mount_num].path; - emulator.serial0_send("mkdir -p /mnt" + path + "\n"); - emulator.serial0_send("rmdir /mnt" + path + "\n"); - emulator.serial0_send("echo done-premount\n"); - next_trigger = "done-premount"; - next_trigger_handler = () => mount(mount_num); - } - - function mount(mount_num) - { - const { path, baseurl, basefs } = tests[test_num].mounts[mount_num]; - emulator.mount_fs(path, baseurl, basefs, err => - { - if(err) - { - log_warn("Failed to mount fs required for test %s: %s", - tests[test_num].name, err); - test_fail(); - } - if(mount_num + 1 < tests[test_num].mounts.length) - { - premount(mount_num + 1); - } - else - { - if(test_has_failed) - { - report_test(); - } - else - { - load_files(); - } - } - }); + for(const { path, baseurl, basefs } of tests[test_num].mounts) + { + await async function() { + return new Promise((resolve, reject) => { + emulator.serial0_send("mkdir -p /mnt" + path + "\n"); + emulator.serial0_send("rmdir /mnt" + path + "\n"); + emulator.serial0_send("echo done-premount\n"); + next_trigger = "done-premount"; + next_trigger_handler = resolve; + }); + }(); + emulator.mount_fs(path, baseurl, basefs); } } - else - { - load_files(); - } -} -async function load_files() -{ console.log(" Loading additional files"); if(tests[test_num].files) { @@ -1664,29 +1599,9 @@ async function load_files() for(const f of tests[test_num].files) { await emulator.create_file(f.file, f.data); - - remaining--; - if(!remaining) - { - if(test_has_failed) - { - report_test(); - } - else - { - start_test(); - } - } } } - else - { - start_test(); - } -} -function start_test() -{ console.log("Starting test #%d: %s", test_num, tests[test_num].name); capture = ""; @@ -1731,17 +1646,17 @@ function report_test() { if(!test_has_failed) { - log_pass("Test #%d passed: %s", test_num, tests[test_num].name); + console.log("[+] Test #%d passed: %s", test_num, tests[test_num].name); } else { if(tests[test_num].allow_failure) { - log_warn("Test #%d failed: %s (failure allowed)", test_num, tests[test_num].name); + console.warn("Test #%d failed: %s (failure allowed)", test_num, tests[test_num].name); } else { - log_fail("Test #%d failed: %s", test_num, tests[test_num].name); + console.error("[-] Test #%d failed: %s", test_num, tests[test_num].name); if(STOP_ON_FIRST_FAILURE) { @@ -1755,7 +1670,7 @@ function report_test() if(test_num < tests.length) { - nuke_fs(); + prepare_test(); } else { @@ -1776,17 +1691,17 @@ function finish_tests() { let unallowed_failure = false; - console.error("Failed %d out of %d tests:", failed_tests.length, tests.length); + console.error("[-] Failed %d out of %d tests:", failed_tests.length, tests.length); for(const num of failed_tests) { if(tests[num].allow_failure) { - log_warn("#%d %s (failure allowed)", num, tests[num].name); + console.warn("#%d %s (failure allowed)", num, tests[num].name); } else { unallowed_failure = true; - log_fail("#%d %s", num, tests[num].name); + console.error("[-] #%d %s", num, tests[num].name); } } if(unallowed_failure) @@ -1798,7 +1713,7 @@ function finish_tests() emulator.bus.register("emulator-started", function() { - console.error("Booting now, please stand by"); + console.log("Booting now, please stand by"); }); emulator.add_listener("serial0-output-byte", function(byte) @@ -1825,7 +1740,7 @@ emulator.add_listener("serial0-output-byte", function(byte) if(!ran_command && line.endsWith("~% ")) { ran_command = true; - nuke_fs(); + prepare_test(); } else if(new_line === next_trigger) { diff --git a/tests/devices/wisp_network.js b/tests/devices/wisp_network.js index e0f4d90a23..b20af10fda 100755 --- a/tests/devices/wisp_network.js +++ b/tests/devices/wisp_network.js @@ -9,28 +9,11 @@ const V86 = require(`../../build/${TEST_RELEASE_BUILD ? "libv86" : "libv86-debug const assert = require("assert").strict; const SHOW_LOGS = false; -const STOP_ON_FIRST_FAILURE = false; - -function log_pass(msg, ...args) -{ - console.log(`\x1b[92m[+] ${msg}\x1b[0m`, ...args); -} - -function log_warn(msg, ...args) -{ - console.error(`\x1b[93m[!] ${msg}\x1b[0m`, ...args); -} - -function log_fail(msg, ...args) -{ - console.error(`\x1b[91m[-] ${msg}\x1b[0m`, ...args); -} const tests = [ { name: "DHCP", - timeout: 60, start: () => { emulator.serial0_send("udhcpc\n"); @@ -44,7 +27,6 @@ const tests = }, { name: "ifconfig", - timeout: 60, start: () => { emulator.serial0_send("ifconfig\n"); @@ -58,7 +40,6 @@ const tests = }, { name: "route", - timeout: 60, start: () => { emulator.serial0_send("ip route\n"); @@ -72,7 +53,6 @@ const tests = }, //{ // name: "arp -a", - // timeout: 60, // start: () => // { // emulator.serial0_send("arp -a\n"); @@ -86,7 +66,6 @@ const tests = //}, { name: "Curl example.org", - timeout: 60, allow_failure: true, start: () => { @@ -102,10 +81,6 @@ const tests = ]; -let test_num = 0; -let test_timeout = 0; -const failed_tests = []; - const emulator = new V86({ bios: { url: __dirname + "/../../bios/seabios.bin" }, vga_bios: { url: __dirname + "/../../bios/vgabios.bin" }, @@ -117,196 +92,89 @@ const emulator = new V86({ log_level: SHOW_LOGS ? 0x400000 : 0, }); -emulator.add_listener("emulator-ready", function () { - -}); - -let ran_command = false; +let test_num = 0; +let booted = false; let line = ""; -let capturing = false; let capture = ""; -let next_trigger; -let next_trigger_handler; +let end_trigger; -function start_timeout() -{ - if(tests[test_num].timeout) - { - test_timeout = setTimeout(() => - { - log_fail("Test #%d (%s) took longer than %s sec. Timing out and terminating.", test_num, tests[test_num].name, tests[test_num].timeout); - process.exit(1); - }, tests[test_num].timeout * 1000); - } -} - -function begin() +emulator.bus.register("emulator-started", function() { - start_timeout(); - - console.log("\nPreparing test #%d: %s", test_num, tests[test_num].name); - start_test(); -} + console.log("Booting now, please stand by"); +}); -function start_test() +emulator.add_listener("serial0-output-byte", function(byte) { - console.log("Starting test #%d: %s", test_num, tests[test_num].name); - - capture = ""; - - tests[test_num].start(); + const chr = String.fromCharCode(byte); + if(chr < " " && chr !== "\n" && chr !== "\t" || chr > "~") + { + return; + } - if(tests[test_num].capture_trigger) + let new_line = ""; + if(chr === "\n") { - next_trigger = tests[test_num].capture_trigger; - next_trigger_handler = start_capture; + console.log(" Captured: %s", line); + new_line = line; + capture += line + "\n"; + line = ""; } else { - next_trigger = tests[test_num].end_trigger; - next_trigger_handler = end_test; + line += chr; } - start_capture(); -} - -function start_capture() -{ - console.log("Capturing..."); - capture = ""; - capturing = true; - - next_trigger = tests[test_num].end_trigger; - next_trigger_handler = end_test; -} - -function end_test() -{ - capturing = false; - if(tests[test_num].timeout) + if(new_line === end_trigger) { - clearTimeout(test_timeout); - } - - let test_has_failed = false; + let test_has_failed = false; - try { - tests[test_num].end(capture); - } catch(e) { - console.log(e); - test_has_failed = true; - } + try { + tests[test_num].end(capture); + } catch(e) { + console.log(e); + test_has_failed = true; + } - if(!test_has_failed) - { - log_pass("Test #%d passed: %s", test_num, tests[test_num].name); - } - else - { - if(tests[test_num].allow_failure) + if(!test_has_failed) { - log_warn("Test #%d failed: %s (failure allowed)", test_num, tests[test_num].name); + console.log("[+] Test #%d passed: %s", test_num, tests[test_num].name); } else { - log_fail("Test #%d failed: %s", test_num, tests[test_num].name); - - if(STOP_ON_FIRST_FAILURE) + if(tests[test_num].allow_failure) + { + console.warn("[!] Test #%d failed: %s (failure allowed)", test_num, tests[test_num].name); + } + else { - finish_tests(); + console.error("[-] Test #%d failed: %s", test_num, tests[test_num].name); + process.exit(1); } } - test_has_failed = false; - } - test_num++; + test_num++; - if(test_num < tests.length) - { - begin(); } - else - { - finish_tests(); - } -} - -function finish_tests() -{ - emulator.stop(); - emulator.destroy(); - console.log("\nTests finished."); - if(failed_tests.length === 0) + if(!booted && line.endsWith("~% ") || new_line === end_trigger) { - console.log("All tests passed"); - } - else - { - let unallowed_failure = false; + booted = true; - console.error("Failed %d out of %d tests:", failed_tests.length, tests.length); - for(const num of failed_tests) + if(test_num >= tests.length) { - if(tests[num].allow_failure) - { - log_warn("#%d %s (failure allowed)", num, tests[num].name); - } - else - { - unallowed_failure = true; - log_fail("#%d %s", num, tests[num].name); - } + emulator.stop(); + emulator.destroy(); + + console.log("Tests finished."); } - if(unallowed_failure) + else { - process.exit(1); - } - } -} + console.log("Starting test #%d: %s", test_num, tests[test_num].name); -emulator.bus.register("emulator-started", function() -{ - console.error("Booting now, please stand by"); -}); + capture = ""; + end_trigger = tests[test_num].end_trigger; -emulator.add_listener("serial0-output-byte", function(byte) -{ - const chr = String.fromCharCode(byte); - if(chr < " " && chr !== "\n" && chr !== "\t" || chr > "~") - { - return; - } - - let new_line = ""; - let is_new_line = false; - if(chr === "\n") - { - is_new_line = true; - new_line = line; - line = ""; - } - else - { - line += chr; - } - - if(!ran_command && line.endsWith("~% ")) - { - ran_command = true; - begin(); - } - else if(new_line === next_trigger) - { - next_trigger_handler(); - } - else if(is_new_line && capturing) - { - capture += new_line + "\n"; - console.log(" Captured: %s", new_line); - } - else if(is_new_line) - { - console.log(" Serial: %s", new_line); + tests[test_num].start(); + } } }); diff --git a/tests/jit-paging/run.js b/tests/jit-paging/run.js index 1e32b0d602..735e09d5e5 100755 --- a/tests/jit-paging/run.js +++ b/tests/jit-paging/run.js @@ -23,7 +23,7 @@ var emulator = new V86({ emulator.bus.register("emulator-started", function() { - console.error("Booting now, please stand by"); + console.log("Booting now, please stand by"); emulator.create_file("test-jit", test_executable); }); diff --git a/tests/qemu/run.js b/tests/qemu/run.js index eb603531cd..51c593fc03 100755 --- a/tests/qemu/run.js +++ b/tests/qemu/run.js @@ -23,7 +23,6 @@ var emulator = new V86({ emulator.bus.register("emulator-started", function() { - console.error("Booting now, please stand by"); emulator.create_file("test-i386", test_executable); });