From 771568a5a5bdd2bf8a9f9fe3c9cc80c81387b43a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Fri, 5 May 2017 11:39:52 +0200 Subject: [PATCH] test: add test for timers benchmarks PR-URL: https://github.com/nodejs/node/pull/12851 Reviewed-By: Rich Trott Reviewed-By: James M Snell --- test/parallel/test-benchmark-timers.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/parallel/test-benchmark-timers.js diff --git a/test/parallel/test-benchmark-timers.js b/test/parallel/test-benchmark-timers.js new file mode 100644 index 00000000000000..5026de1a8edd35 --- /dev/null +++ b/test/parallel/test-benchmark-timers.js @@ -0,0 +1,21 @@ +'use strict'; + +require('../common'); + +// Minimal test for timers benchmarks. This makes sure the benchmarks aren't +// horribly broken but nothing more than that. + +const assert = require('assert'); +const fork = require('child_process').fork; +const path = require('path'); + +const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js'); +const argv = ['--set', 'thousands=0.001', + '--set', 'millions=0.000001', + 'timers']; + +const child = fork(runjs, argv, {env: {NODEJS_BENCHMARK_ZERO_ALLOWED: 1}}); +child.on('exit', (code, signal) => { + assert.strictEqual(code, 0); + assert.strictEqual(signal, null); +});