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 <joyeec9h3@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent e6be4b9 commit b7aeed7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

benchmark/_cli.js

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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)