Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Dec 15, 2019
1 parent 65622bf commit 6e0fd1c
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions test/parallel/test-startup-large-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@ require('../common');
const assert = require('assert');
const { spawnSync } = require('child_process');

const child = spawnSync(process.execPath, [ '--use-largepages', '-p', '42' ]);
const stdout = child.stdout.toString().match(/\S+/g);
{
const child = spawnSync(process.execPath,
[ '--use-largepages=1', '-p', '42' ]);
const stdout = child.stdout.toString().match(/\S+/g);
assert.strictEqual(child.status, 0);
assert.strictEqual(child.signal, null);
assert.strictEqual(stdout.length, 1);
assert.strictEqual(stdout[0], '42');
}

assert.strictEqual(child.status, 0);
assert.strictEqual(child.signal, null);
assert.strictEqual(stdout.length, 1);
assert.strictEqual(stdout[0], '42');
{
const child = spawnSync(process.execPath,
[ '--use-largepages=3', '-p', '42' ]);
assert.strictEqual(child.status, 9);
assert.strictEqual(child.signal, null);
assert.strictEqual(child.stderr.toString().match(/\S+/g).slice(1).join(' '),
'--use-largepages must be one of 0, 1, or 2');
}

// TODO(gabrielschulhof): Make assertions about the stderr, which may or may not
// contain a message indicating that mapping to large pages has failed.
// TODO(gabrielschulhof): Run with --use-largepages=2 and make assertions about
// the stderr, which may or may not contain a message indicating that mapping to
// large pages has failed.

0 comments on commit 6e0fd1c

Please sign in to comment.