Skip to content

Commit

Permalink
Simplify --no-headless option for rustdoc-gui tester
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 30, 2021
1 parent 9981e56 commit 1feeda8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/tools/rustdoc-gui/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,16 @@ async function main(argv) {
}
files.sort();

if (no_headless) {
opts["jobs"] = 1;
console.log("`--no-headless` option is active, disabling concurrency for running tests.");
}

console.log(`Running ${files.length} rustdoc-gui (${opts["jobs"]} concurrently) ...`);

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

Expand Down Expand Up @@ -217,9 +222,7 @@ async function main(argv) {
tests_queue.splice(tests_queue.indexOf(callback), 1);
});
tests_queue.push(callback);
if (no_headless) {
await tests_queue[i];
} else if (opts["jobs"] > 0 && tests_queue.length >= opts["jobs"]) {
if (opts["jobs"] > 0 && tests_queue.length >= opts["jobs"]) {
await Promise.race(tests_queue);
}
}
Expand Down

0 comments on commit 1feeda8

Please sign in to comment.