Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to browser-ui-test #97354

Merged
merged 2 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.3
0.9.5
18 changes: 17 additions & 1 deletion src/tools/rustdoc-gui/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function showHelp() {
console.log(" --help : show this message then quit");
console.log(" --tests-folder [PATH] : location of the .GOML tests folder");
console.log(" --jobs [NUMBER] : number of threads to run tests on");
console.log(" --executable-path [PATH] : path of the browser's executable to be used");
}

function isNumeric(s) {
Expand All @@ -34,20 +35,25 @@ function parseOptions(args) {
"show_text": false,
"no_headless": false,
"jobs": -1,
"executable_path": null,
"no_sandbox": false,
};
var correspondances = {
"--doc-folder": "doc_folder",
"--tests-folder": "tests_folder",
"--debug": "debug",
"--show-text": "show_text",
"--no-headless": "no_headless",
"--executable-path": "executable_path",
"--no-sandbox": "no_sandbox",
};

for (var i = 0; i < args.length; ++i) {
if (args[i] === "--doc-folder"
|| args[i] === "--tests-folder"
|| args[i] === "--file"
|| args[i] === "--jobs") {
|| args[i] === "--jobs"
|| args[i] === "--executable-path") {
i += 1;
if (i >= args.length) {
console.log("Missing argument after `" + args[i - 1] + "` option.");
Expand All @@ -68,6 +74,9 @@ function parseOptions(args) {
} else if (args[i] === "--help") {
showHelp();
process.exit(0);
} else if (args[i] === "--no-sandbox") {
console.log("`--no-sandbox` is being used. Be very careful!");
opts[correspondances[args[i]]] = true;
} else if (correspondances[args[i]]) {
opts[correspondances[args[i]]] = true;
} else {
Expand Down Expand Up @@ -147,10 +156,17 @@ async function main(argv) {
if (opts["show_text"]) {
args.push("--show-text");
}
if (opts["no_sandbox"]) {
args.push("--no-sandbox");
}
if (opts["no_headless"]) {
args.push("--no-headless");
headless = false;
}
if (opts["executable_path"] !== null) {
args.push("--executable-path");
args.push(opts["executable_path"]);
}
options.parseArguments(args);
} catch (error) {
console.error(`invalid argument: ${error}`);
Expand Down