Skip to content

Commit 6f34c0d

Browse files
authored
Rollup merge of #91584 - GuillaumeGomez:improve-rustdoc-gui-tester-code, r=jsha
Improve code for rustdoc-gui tester Following advice given in #91391. It nicely improves the code readability. :) r? `@jsha`
2 parents efc49c1 + 4c1e24b commit 6f34c0d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/tools/rustdoc-gui/tester.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async function main(argv) {
133133
// Print successful tests too
134134
let debug = false;
135135
// Run tests in sequentially
136-
let no_headless = false;
136+
let headless = true;
137137
const options = new Options();
138138
try {
139139
// This is more convenient that setting fields one by one.
@@ -150,7 +150,7 @@ async function main(argv) {
150150
}
151151
if (opts["no_headless"]) {
152152
args.push("--no-headless");
153-
no_headless = true;
153+
headless = false;
154154
}
155155
options.parseArguments(args);
156156
} catch (error) {
@@ -172,7 +172,7 @@ async function main(argv) {
172172
}
173173
files.sort();
174174

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

182182
if (opts["jobs"] < 1) {
183183
process.setMaxListeners(files.length + 1);
184-
} else if (!no_headless) {
184+
} else if (headless) {
185185
process.setMaxListeners(opts["jobs"] + 1);
186186
}
187187

@@ -226,7 +226,7 @@ async function main(argv) {
226226
await Promise.race(tests_queue);
227227
}
228228
}
229-
if (!no_headless && tests_queue.length > 0) {
229+
if (tests_queue.length > 0) {
230230
await Promise.all(tests_queue);
231231
}
232232
status_bar.finish();

0 commit comments

Comments
 (0)