Skip to content
Open
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
15 changes: 9 additions & 6 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ function parseCliFlag(argument) {
throw Error(message);
}
let value = parts.slice(1).join("=");
if (flagName === "no-prefetch") value = "false";
if (flagName.startsWith("no-")) value = "false";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have some other parameter that uses this --no prefix? Or rather: all other boolean parameters are set to false by default, whereas prefetchResources is true, right? So maybe don't generify this just yet, since supplying, e.g., --no-ramification does nothing, right?

else if (value === "") value = "true";
cliParams.set(CLI_PARAMS[flagName].param, value);
}


const printHelp = cliParams.delete("help");
const dumpTestList = cliParams.delete("dumpTestList");

if (cliArgs.length) {
let tests = cliParams.has("test") ? cliParams.get("tests").split(",") : []
tests = tests.concat(cliArgs);
Expand All @@ -126,7 +129,6 @@ if (cliParams.size)

load("./utils/params.js");


async function runJetStream() {
try {
await JetStream.initialize();
Expand Down Expand Up @@ -169,10 +171,11 @@ function help(message=undefined) {
}
}

if (cliParams.has("help")) {

if (printHelp) {
help();
} else if (cliParams.has("dumpTestList")) {
JetStream.dumpTestList();
} else if (dumpTestList) {
JetStream.dumpTestList();
} else {
runJetStream();
runJetStream();
}
7 changes: 7 additions & 0 deletions tests/run-shell.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ const TESTS = [
return runTest("UnitTests", () => sh(shell_binary, UNIT_TEST_PATH));
},
},
{
name: "CLI Help",
tags: ["all", "main", "help"],
run(shell_binary) {
return runCLITest("Cli Help", shell_binary, "--help");
},
},
{
name: "Single Suite",
tags: ["all", "main", "single"],
Expand Down
2 changes: 0 additions & 2 deletions utils/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class Params {
RAMification = false;
forceGC = false;
dumpJSONResults = false;
dumpTestList = false;
// Override iteration and worst-case counts per workload.
// Example:
// testIterationCountMap = { "acorn-wtb": 5 };
Expand All @@ -70,7 +69,6 @@ class Params {
this.RAMification = this._parseBooleanParam(sourceParams, "RAMification");
this.dumpJSONResults = this._parseBooleanParam(sourceParams, "dumpJSONResults");
this.groupDetails = this._parseBooleanParam(sourceParams, "groupDetails");
this.dumpTestList = this._parseBooleanParam(sourceParams, "dumpTestList");
this.forceGC = this._parseBooleanParam(sourceParams, "forceGC");

this.customPreIterationCode = this._parseStringParam(sourceParams, "customPreIterationCode");
Expand Down
Loading