diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2017-04-11 11:18:48 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2017-04-19 22:58:26 +0800 |
commit | 3d7c82bd612ebb9190d54b80c90ceed3310161aa (patch) | |
tree | 53f9162305eb5605d662be0ac4c5ab050f73e796 /test/sequential/test-benchmark-child-process.js | |
parent | 211813c99c97e2c48c67323a7ee5cb2ed7f03d57 (diff) | |
download | android-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.js | 19 |
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); +}); |