diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-06 00:11:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-06 00:11:48 +0100 |
| commit | 9c777fc6b0b2bc78a40838b6b24e8aa0ff49e8ed (patch) | |
| tree | 16fa70d65dca44688c36583756cf01aacc412821 | |
| parent | bd98a79eea30a0363beefddbb971b89e2b389660 (diff) | |
| parent | 1feeda80a058faa724770582d4a11c05ccb88e08 (diff) | |
| download | rust-9c777fc6b0b2bc78a40838b6b24e8aa0ff49e8ed.tar.gz rust-9c777fc6b0b2bc78a40838b6b24e8aa0ff49e8ed.zip | |
Rollup merge of #91391 - GuillaumeGomez:simplify-no-headless, r=jsha
Simplify --no-headless option for rustdoc-gui tester It adds a message stating the change for the concurrency and also remove the extra condition when running the tests. r? `@camelid`
| -rw-r--r-- | src/tools/rustdoc-gui/tester.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/tools/rustdoc-gui/tester.js b/src/tools/rustdoc-gui/tester.js index 0d6a2605d4f..3feb4940d87 100644 --- a/src/tools/rustdoc-gui/tester.js +++ b/src/tools/rustdoc-gui/tester.js @@ -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); } @@ -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); } } |
