summaryrefslogtreecommitdiff
path: root/test/sequential
diff options
context:
space:
mode:
authorEmily Marigold Klassen <forivall@gmail.com>2018-10-12 11:13:33 -0700
committerRich Trott <rtrott@gmail.com>2018-10-24 06:58:19 -0700
commit8c99a224d21b7ab81711c3c0103b1eada82c0613 (patch)
tree3a543f916a2287d036f2d3ccc9c2edd43ff7823c /test/sequential
parent3ec8cec6483549a91d1c89bed3c15856b71850c3 (diff)
downloadandroid-node-v8-8c99a224d21b7ab81711c3c0103b1eada82c0613.tar.gz
android-node-v8-8c99a224d21b7ab81711c3c0103b1eada82c0613.tar.bz2
android-node-v8-8c99a224d21b7ab81711c3c0103b1eada82c0613.zip
test: add test-benchmark-napi
Also makes sure that the napi benchmark is built before running jstest. Skipped on windows since n-api benchmarks aren't built there yet. PR-URL: https://github.com/nodejs/node/pull/23585 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'test/sequential')
-rw-r--r--test/sequential/test-benchmark-napi.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/sequential/test-benchmark-napi.js b/test/sequential/test-benchmark-napi.js
new file mode 100644
index 0000000000..1a1ff23d60
--- /dev/null
+++ b/test/sequential/test-benchmark-napi.js
@@ -0,0 +1,24 @@
+'use strict';
+
+const common = require('../common');
+
+if (common.isWindows) {
+ common.skip('vcbuild.bat doesn\'t build the n-api benchmarks yet');
+}
+
+if (!common.isMainThread) {
+ common.skip('addons are not supported in workers');
+}
+
+if (process.features.debug) {
+ common.skip('benchmark does not work with debug build yet');
+}
+const runBenchmark = require('../common/benchmark');
+
+runBenchmark('napi',
+ [
+ 'n=1',
+ 'engine=v8',
+ 'type=String'
+ ],
+ { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });