Skip to content

Commit

Permalink
test: fix abort/test-abort-uncaught-exception
Browse files Browse the repository at this point in the history
The --abort-on-uncaught-exception can terminate the process with either
a SIGABRT or a SIGILL signal but the test only expected SIGABRT.

PR-URL: #6734
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
bnoordhuis authored and Fishrock123 committed Jul 5, 2016
1 parent 4b0ab5b commit c7ab7a3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/abort/test-abort-uncaught-exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,26 @@ if (process.argv[2] === 'child') {
throw new Error('child error');
} else {
run('', null);
run('--abort-on-uncaught-exception', 'SIGABRT');
run('--abort-on-uncaught-exception', ['SIGABRT', 'SIGILL']);
}

function run(flags, signal) {
function run(flags, signals) {
const args = [__filename, 'child'];
if (flags)
args.unshift(flags);

const child = spawn(node, args);
child.on('exit', common.mustCall(function(code, sig) {
if (!common.isWindows) {
assert.strictEqual(sig, signal);
} else {
if (signal)
if (common.isWindows) {
if (signals)
assert.strictEqual(code, 3);
else
assert.strictEqual(code, 1);
} else {
if (signals)
assert.strictEqual(signals.includes(sig), true);
else
assert.strictEqual(sig, null);
}
}));
}

0 comments on commit c7ab7a3

Please sign in to comment.