mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test: convert buffer benchmark to runBenchmark
PR-URL: https://github.com/nodejs/node/pull/15349 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
This commit is contained in:
@@ -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);
|
||||
});
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user