Skip to content

Commit

Permalink
benchmark: improve cli error message
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mscdex authored and evanlucas committed May 2, 2017
1 parent e6be4b9 commit b7aeed7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions benchmark/_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ CLI.prototype.benchmarks = function() {
const filter = this.optional.filter || false;

for (const category of this.items) {
if (benchmarks[category] === undefined)
continue;
for (const scripts of benchmarks[category]) {
if (filter && scripts.lastIndexOf(filter) === -1) continue;

Expand Down
2 changes: 1 addition & 1 deletion benchmark/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const runs = cli.optional.runs ? parseInt(cli.optional.runs, 10) : 30;
const benchmarks = cli.benchmarks();

if (benchmarks.length === 0) {
console.error('no benchmarks found');
console.error('No benchmarks found');
process.exitCode = 1;
return;
}
Expand Down

0 comments on commit b7aeed7

Please sign in to comment.