|
2 | 2 |
|
3 | 3 | require('../common');
|
4 | 4 |
|
5 |
| -// Minimal test for buffer benchmarks. This makes sure the benchmarks aren't |
6 |
| -// completely broken but nothing more than that. |
| 5 | +const runBenchmark = require('../common/benchmark'); |
7 | 6 |
|
8 |
| -const assert = require('assert'); |
9 |
| -const fork = require('child_process').fork; |
10 |
| -const path = require('path'); |
| 7 | +runBenchmark('buffers', |
| 8 | + [ |
| 9 | + 'aligned=true', |
| 10 | + 'args=1', |
| 11 | + 'encoding=utf8', |
| 12 | + 'len=2', |
| 13 | + 'method=', |
| 14 | + 'n=1', |
| 15 | + 'noAssert=true', |
| 16 | + 'pieces=1', |
| 17 | + 'pieceSize=1', |
| 18 | + 'search=@', |
| 19 | + 'size=1', |
| 20 | + 'source=array', |
| 21 | + 'type=', |
| 22 | + 'withTotalLength=0' |
11 | 23 |
|
12 |
| -const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js'); |
13 |
| -const argv = ['--set', 'aligned=true', |
14 |
| - '--set', 'args=1', |
15 |
| - '--set', 'buffer=fast', |
16 |
| - '--set', 'encoding=utf8', |
17 |
| - '--set', 'len=2', |
18 |
| - '--set', 'method=', |
19 |
| - '--set', 'n=1', |
20 |
| - '--set', 'noAssert=true', |
21 |
| - '--set', 'pieces=1', |
22 |
| - '--set', 'pieceSize=1', |
23 |
| - '--set', 'search=@', |
24 |
| - '--set', 'size=1', |
25 |
| - '--set', 'source=array', |
26 |
| - '--set', 'type=', |
27 |
| - '--set', 'withTotalLength=0', |
28 |
| - 'buffers']; |
29 |
| - |
30 |
| -const child = fork(runjs, argv); |
31 |
| -child.on('exit', (code, signal) => { |
32 |
| - assert.strictEqual(code, 0); |
33 |
| - assert.strictEqual(signal, null); |
34 |
| -}); |
| 24 | + ]); |
0 commit comments