From a9066459aded144e7200a3596ab56b3a00c6881e Mon Sep 17 00:00:00 2001 From: Jon Moss Date: Mon, 11 Sep 2017 17:34:39 -0400 Subject: [PATCH] test: convert buffer benchmark to runBenchmark PR-URL: https://github.com/nodejs/node/pull/15349 Reviewed-By: Rich Trott Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Refael Ackermann Reviewed-By: Yuta Hiroto --- test/sequential/test-benchmark-buffer.js | 46 ++++++++++-------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/test/sequential/test-benchmark-buffer.js b/test/sequential/test-benchmark-buffer.js index 64a9a65058bb24..73d8e0391d1cc3 100644 --- a/test/sequential/test-benchmark-buffer.js +++ b/test/sequential/test-benchmark-buffer.js @@ -2,33 +2,23 @@ require('../common'); -// Minimal test for buffer benchmarks. This makes sure the benchmarks aren't -// completely broken but nothing more than that. +const runBenchmark = require('../common/benchmark'); -const assert = require('assert'); -const fork = require('child_process').fork; -const path = require('path'); +runBenchmark('buffers', + [ + 'aligned=true', + 'args=1', + 'encoding=utf8', + 'len=2', + 'method=', + 'n=1', + 'noAssert=true', + 'pieces=1', + 'pieceSize=1', + 'search=@', + 'size=1', + 'source=array', + 'type=', + 'withTotalLength=0' -const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js'); -const argv = ['--set', 'aligned=true', - '--set', 'args=1', - '--set', 'buffer=fast', - '--set', 'encoding=utf8', - '--set', 'len=2', - '--set', 'method=', - '--set', 'n=1', - '--set', 'noAssert=true', - '--set', 'pieces=1', - '--set', 'pieceSize=1', - '--set', 'search=@', - '--set', 'size=1', - '--set', 'source=array', - '--set', 'type=', - '--set', 'withTotalLength=0', - 'buffers']; - -const child = fork(runjs, argv); -child.on('exit', (code, signal) => { - assert.strictEqual(code, 0); - assert.strictEqual(signal, null); -}); + ]);