Allow logging screen while running full test

This commit is contained in:
Fabian 2021-04-10 16:52:42 -05:00
parent b1025783a1
commit f48c851b17

View file

@ -10,6 +10,7 @@ const TEST_RELEASE_BUILD = +process.env.TEST_RELEASE_BUILD;
const VERBOSE = false; const VERBOSE = false;
const RUN_SLOW_TESTS = false; const RUN_SLOW_TESTS = false;
const LOG_SCREEN = false;
try try
{ {
@ -901,6 +902,8 @@ function run_test(test, done)
var on_text = []; var on_text = [];
var stopped = false; var stopped = false;
var screen_interval = null;
function check_test_done() function check_test_done()
{ {
if(stopped) if(stopped)
@ -920,6 +923,11 @@ function run_test(test, done)
emulator.stop(); emulator.stop();
if(screen_interval !== null)
{
clearInterval(screen_interval);
}
console.warn("Passed test: %s (took %ds)", test.name, (end - test_start) / 1000); console.warn("Passed test: %s (took %ds)", test.name, (end - test_start) / 1000);
console.warn(); console.warn();
@ -930,6 +938,11 @@ function run_test(test, done)
for(let timeout of timeouts) clearTimeout(timeout); for(let timeout of timeouts) clearTimeout(timeout);
stopped = true; stopped = true;
if(screen_interval !== null)
{
clearInterval(screen_interval);
}
emulator.stop(); emulator.stop();
emulator.destroy(); emulator.destroy();
@ -1039,12 +1052,12 @@ function run_test(test, done)
} }
}); });
//if(VERBOSE) if(LOG_SCREEN)
//{ {
// setInterval(() => { screen_interval = setInterval(() => {
// console.warn(screen_to_text(screen)); console.warn(screen_to_text(screen));
// }, 10000); }, 10000);
//} }
let serial_line = ""; let serial_line = "";
emulator.add_listener("serial0-output-char", function(c) emulator.add_listener("serial0-output-char", function(c)