summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2017-04-15 02:51:10 -0400
committerJames M Snell <jasnell@gmail.com>2017-04-17 14:48:40 -0700
commitccdcd9168a25772d671a7f73db4dc81864267e40 (patch)
treeaecd7ae9105b34b5d506e64b1eeb14f41cdfe21b
parent716d831a64bcb2c4c4471f1c1bf1bdc0bfb8529b (diff)
downloadandroid-node-v8-ccdcd9168a25772d671a7f73db4dc81864267e40.tar.gz
android-node-v8-ccdcd9168a25772d671a7f73db4dc81864267e40.tar.bz2
android-node-v8-ccdcd9168a25772d671a7f73db4dc81864267e40.zip
benchmark: improve cli error message
When no matching benchmark files are found, a more sensible error is shown now. PR-URL: https://github.com/nodejs/node/pull/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>
-rw-r--r--benchmark/_cli.js2
-rw-r--r--benchmark/compare.js2
2 files changed, 3 insertions, 1 deletions
diff --git a/benchmark/_cli.js b/benchmark/_cli.js
index 17718c4c4d..4d92b05b1b 100644
--- a/benchmark/_cli.js
+++ b/benchmark/_cli.js
@@ -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;
diff --git a/benchmark/compare.js b/benchmark/compare.js
index a671bc9f3d..4d183a10e2 100644
--- a/benchmark/compare.js
+++ b/benchmark/compare.js
@@ -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;
}