aboutsummaryrefslogtreecommitdiff
path: root/test/sequential/test-benchmark-child-process.js
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2017-04-11 11:18:48 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2017-04-19 22:58:26 +0800
commit3d7c82bd612ebb9190d54b80c90ceed3310161aa (patch)
tree53f9162305eb5605d662be0ac4c5ab050f73e796 /test/sequential/test-benchmark-child-process.js
parent211813c99c97e2c48c67323a7ee5cb2ed7f03d57 (diff)
downloadandroid-node-v8-3d7c82bd612ebb9190d54b80c90ceed3310161aa.tar.gz
android-node-v8-3d7c82bd612ebb9190d54b80c90ceed3310161aa.tar.bz2
android-node-v8-3d7c82bd612ebb9190d54b80c90ceed3310161aa.zip
test: add test for child_process benchmark
PR-URL: https://github.com/nodejs/node/pull/12326 Ref: https://github.com/nodejs/node/issues/12068 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Diffstat (limited to 'test/sequential/test-benchmark-child-process.js')
-rw-r--r--test/sequential/test-benchmark-child-process.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/sequential/test-benchmark-child-process.js b/test/sequential/test-benchmark-child-process.js
new file mode 100644
index 0000000000..4acad7d0f7
--- /dev/null
+++ b/test/sequential/test-benchmark-child-process.js
@@ -0,0 +1,19 @@
+'use strict';
+
+require('../common');
+
+const assert = require('assert');
+const fork = require('child_process').fork;
+const path = require('path');
+
+const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js');
+
+const child = fork(runjs, ['--set', 'dur=0.1',
+ '--set', 'n=1',
+ '--set', 'len=1',
+ 'child_process'],
+ {env: {NODEJS_BENCHMARK_ZERO_ALLOWED: 1}});
+child.on('exit', (code, signal) => {
+ assert.strictEqual(code, 0);
+ assert.strictEqual(signal, null);
+});