Implement a finish method for the status_bar and some cleanup
This commit is contained in:
parent
c17628be18
commit
86fa21cda5
1 changed files with 11 additions and 5 deletions
|
@ -5,6 +5,7 @@
|
||||||
// ```
|
// ```
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
const os = require('os');
|
||||||
const {Options, runTest} = require('browser-ui-test');
|
const {Options, runTest} = require('browser-ui-test');
|
||||||
|
|
||||||
function showHelp() {
|
function showHelp() {
|
||||||
|
@ -78,7 +79,7 @@ function char_printer(n_tests) {
|
||||||
successful: function() {
|
successful: function() {
|
||||||
current += 1;
|
current += 1;
|
||||||
if (current % max_per_line === 0) {
|
if (current % max_per_line === 0) {
|
||||||
process.stdout.write(`. (${current}/${n_tests})\n`);
|
process.stdout.write(`. (${current}/${n_tests})${os.EOL}`);
|
||||||
} else {
|
} else {
|
||||||
process.stdout.write(".");
|
process.stdout.write(".");
|
||||||
}
|
}
|
||||||
|
@ -86,11 +87,15 @@ function char_printer(n_tests) {
|
||||||
erroneous: function() {
|
erroneous: function() {
|
||||||
current += 1;
|
current += 1;
|
||||||
if (current % max_per_line === 0) {
|
if (current % max_per_line === 0) {
|
||||||
process.stderr.write(`F (${current}/${n_tests})\n`);
|
process.stderr.write(`F (${current}/${n_tests})${os.EOL}`);
|
||||||
} else {
|
} else {
|
||||||
process.stderr.write("F");
|
process.stderr.write("F");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
finish: function() {
|
||||||
|
const spaces = " ".repeat(max_per_line - (current % max_per_line));
|
||||||
|
process.stdout.write(`${spaces} (${current}/${n_tests})${os.EOL}${os.EOL}`);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,9 +192,10 @@ async function main(argv) {
|
||||||
await tests[i];
|
await tests[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await Promise.all(tests);
|
if (!no_headless) {
|
||||||
// final \n after the tests
|
await Promise.all(tests);
|
||||||
console.log("\n");
|
}
|
||||||
|
status_bar.finish();
|
||||||
|
|
||||||
if (debug === false) {
|
if (debug === false) {
|
||||||
results.successful.sort(by_filename);
|
results.successful.sort(by_filename);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue