Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Fix test-exception.js for PPC #24

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ exports.findReports = (pid) => {
return files.filter((file) => filePattern.test(file));
};

exports.isPPC = () => {
return process.arch.startsWith('ppc');
};

exports.isWindows = () => {
return process.platform === 'win32';
};

exports.validate = (t, report, pid) => {
t.test('Validating ' + report, (t) => {
fs.readFile(report, (err, data) => {
Expand Down
5 changes: 3 additions & 2 deletions test/test-exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ if (process.argv[2] === 'child') {

const child = spawn(process.execPath, [__filename, 'child']);
child.on('exit', (code, signal) => {
const expectedExitCode = process.platform === 'win32' ? 0xC0000005 : null;
const expectedSignal = process.platform === 'win32' ? null : 'SIGILL';
const expectedExitCode = common.isWindows() ? 0xC0000005 : null;
const expectedSignal = common.isWindows() ? null :
common.isPPC() ? 'SIGTRAP' : 'SIGILL';
tap.plan(4);
tap.equal(code, expectedExitCode, 'Process should not exit cleanly');
tap.equal(signal, expectedSignal,
Expand Down
2 changes: 1 addition & 1 deletion test/test-signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (process.argv[2] === 'child') {
const fork = require('child_process').fork;
const tap = require('tap');

if (process.platform === 'win32') {
if (common.isWindows()) {
tap.fail('Unsupported on Windows', { skip: true });
return;
}
Expand Down