Skip to content

Commit b7aeed7

Browse files
mscdexevanlucas
authored andcommitted
benchmark: improve cli error message
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: #12421 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Alexey Orlenko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e6be4b9 commit b7aeed7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

benchmark/_cli.js

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ CLI.prototype.benchmarks = function() {
8888
const filter = this.optional.filter || false;
8989

9090
for (const category of this.items) {
91+
if (benchmarks[category] === undefined)
92+
continue;
9193
for (const scripts of benchmarks[category]) {
9294
if (filter && scripts.lastIndexOf(filter) === -1) continue;
9395

benchmark/compare.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const runs = cli.optional.runs ? parseInt(cli.optional.runs, 10) : 30;
3535
const benchmarks = cli.benchmarks();
3636

3737
if (benchmarks.length === 0) {
38-
console.error('no benchmarks found');
38+
console.error('No benchmarks found');
3939
process.exitCode = 1;
4040
return;
4141
}

0 commit comments

Comments
 (0)