test: fix abort/test-abort-uncaught-exception
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: https://github.com/nodejs/node/pull/6734 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
5251fe52c3
commit
0672fca921
@ -9,23 +9,26 @@ if (process.argv[2] === 'child') {
|
|||||||
throw new Error('child error');
|
throw new Error('child error');
|
||||||
} else {
|
} else {
|
||||||
run('', null);
|
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'];
|
const args = [__filename, 'child'];
|
||||||
if (flags)
|
if (flags)
|
||||||
args.unshift(flags);
|
args.unshift(flags);
|
||||||
|
|
||||||
const child = spawn(node, args);
|
const child = spawn(node, args);
|
||||||
child.on('exit', common.mustCall(function(code, sig) {
|
child.on('exit', common.mustCall(function(code, sig) {
|
||||||
if (!common.isWindows) {
|
if (common.isWindows) {
|
||||||
assert.strictEqual(sig, signal);
|
if (signals)
|
||||||
} else {
|
|
||||||
if (signal)
|
|
||||||
assert.strictEqual(code, 3);
|
assert.strictEqual(code, 3);
|
||||||
else
|
else
|
||||||
assert.strictEqual(code, 1);
|
assert.strictEqual(code, 1);
|
||||||
|
} else {
|
||||||
|
if (signals)
|
||||||
|
assert.strictEqual(signals.includes(sig), true);
|
||||||
|
else
|
||||||
|
assert.strictEqual(sig, null);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user