Skip to content

Commit

Permalink
Improve code for rustdoc-gui tester
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Dec 6, 2021
1 parent 87dce6e commit 4c1e24b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tools/rustdoc-gui/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async function main(argv) {
// Print successful tests too
let debug = false;
// Run tests in sequentially
let no_headless = false;
let headless = true;
const options = new Options();
try {
// This is more convenient that setting fields one by one.
Expand All @@ -150,7 +150,7 @@ async function main(argv) {
}
if (opts["no_headless"]) {
args.push("--no-headless");
no_headless = true;
headless = false;
}
options.parseArguments(args);
} catch (error) {
Expand All @@ -172,7 +172,7 @@ async function main(argv) {
}
files.sort();

if (no_headless) {
if (!headless) {
opts["jobs"] = 1;
console.log("`--no-headless` option is active, disabling concurrency for running tests.");
}
Expand All @@ -181,7 +181,7 @@ async function main(argv) {

if (opts["jobs"] < 1) {
process.setMaxListeners(files.length + 1);
} else if (!no_headless) {
} else if (headless) {
process.setMaxListeners(opts["jobs"] + 1);
}

Expand Down Expand Up @@ -226,7 +226,7 @@ async function main(argv) {
await Promise.race(tests_queue);
}
}
if (!no_headless && tests_queue.length > 0) {
if (tests_queue.length > 0) {
await Promise.all(tests_queue);
}
status_bar.finish();
Expand Down

0 comments on commit 4c1e24b

Please sign in to comment.