Skip to content

Commit 80a1cf7

Browse files
committed
test: fix messages and use return to skip tests
This is a followup of #2109. The tests which didn't make it in #2109, are included in this patch. The skip messages are supposed to follow the format 1..0 # Skipped: [Actual reason why the test is skipped] and the tests should be skipped with the return statement. PR-URL: #2290 Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Johan Bergström <[email protected]>
1 parent 9bac1db commit 80a1cf7

16 files changed

+32
-27
lines changed

test/disabled/tls_server.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ var certPem = fs.readFileSync(common.fixturesDir + '/cert.pem');
1313
try {
1414
var credentials = crypto.createCredentials({key: keyPem, cert: certPem});
1515
} catch (e) {
16-
console.log('Not compiled with OPENSSL support.');
17-
process.exit();
16+
console.log('1..0 # Skipped: node compiled without OpenSSL.');
17+
return;
1818
}
1919
var i = 0;
2020
var server = net.createServer(function(connection) {

test/parallel/test-child-process-fork-dgram.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ var assert = require('assert');
1919
var common = require('../common');
2020

2121
if (common.isWindows) {
22-
console.error('Sending dgram sockets to child processes not supported');
23-
process.exit(0);
22+
console.log('1..0 # Skipped: Sending dgram sockets to child processes is ' +
23+
'not supported');
24+
return;
2425
}
2526

2627
if (process.argv[2] === 'child') {

test/parallel/test-cluster-bind-privileged-port.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ if (common.isWindows) {
1010
}
1111

1212
if (process.getuid() === 0) {
13-
console.log('Do not run this test as root.');
14-
process.exit(0);
13+
console.log('1..0 # Skipped: Test is not supposed to be run as root.');
14+
return;
1515
}
1616

1717
if (cluster.isMaster) {

test/parallel/test-cluster-dgram-1.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ var dgram = require('dgram');
99

1010

1111
if (common.isWindows) {
12-
console.warn('dgram clustering is currently not supported on windows.');
13-
process.exit(0);
12+
console.log('1..0 # Skipped: dgram clustering is currently not supported ' +
13+
'on windows.');
14+
return;
1415
}
1516

1617
if (cluster.isMaster)

test/parallel/test-cluster-dgram-2.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ var dgram = require('dgram');
99

1010

1111
if (common.isWindows) {
12-
console.warn('dgram clustering is currently not supported on windows.');
13-
process.exit(0);
12+
console.log('1..0 # Skipped: dgram clustering is currently not supported ' +
13+
'on windows.');
14+
return;
1415
}
1516

1617
if (cluster.isMaster)

test/parallel/test-cluster-http-pipe.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ const assert = require('assert');
55
const cluster = require('cluster');
66
const http = require('http');
77

8-
// It is not possible to send pipe handles over the IPC pipe on Windows.
98
if (common.isWindows) {
10-
process.exit(0);
9+
console.log('1..0 # Skipped: It is not possible to send pipe handles over ' +
10+
'the IPC pipe on Windows');
11+
return;
1112
}
1213

1314
if (cluster.isMaster) {

test/parallel/test-dh-padding.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ var assert = require('assert');
55
try {
66
var crypto = require('crypto');
77
} catch (e) {
8-
console.log('Not compiled with OPENSSL support.');
9-
process.exit();
8+
console.log('1..0 # Skipped: node compiled without OpenSSL.');
9+
return;
1010
}
1111

1212
var prime = 'c51f7bf8f0e1cf899243cdf408b1bc7c09c010e33ef7f3fbe5bd5feaf906113b';

test/parallel/test-domain-crypto.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
try {
33
var crypto = require('crypto');
44
} catch (e) {
5-
console.log('Not compiled with OPENSSL support.');
6-
process.exit();
5+
console.log('1..0 # Skipped: node compiled without OpenSSL.');
6+
return;
77
}
88

99
// the missing var keyword is intentional

test/parallel/test-process-remove-all-signal-listeners.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const spawn = require('child_process').spawn;
55
const common = require('../common');
66

77
if (common.isWindows) {
8-
// Win32 doesn't have signals, just a kindof emulation, insufficient
9-
// for this test to apply.
8+
console.log('1..0 # Skipped: Win32 doesn\'t have signals, just a kind of ' +
9+
'emulation, insufficient for this test to apply.');
1010
return;
1111
}
1212

test/parallel/test-signal-handler.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
const common = require('../common');
44
const assert = require('assert');
55

6-
// SIGUSR1 and SIGHUP are not supported on Windows
76
if (common.isWindows) {
8-
process.exit(0);
7+
console.log('1..0 # Skipped: SIGUSR1 and SIGHUP signals are not supported');
8+
return;
99
}
1010

1111
console.log('process.pid: ' + process.pid);

test/parallel/test-tls-npn-server-client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
if (!process.features.tls_npn) {
33
console.log('1..0 # Skipped: node compiled without OpenSSL or ' +
44
'with old OpenSSL version.');
5-
process.exit(0);
5+
return;
66
}
77

88
var common = require('../common'),

test/parallel/test-tls-ocsp-callback.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var common = require('../common');
44
if (!process.features.tls_ocsp) {
55
console.log('1..0 # Skipped: node compiled without OpenSSL or ' +
66
'with old OpenSSL version.');
7-
process.exit(0);
7+
return;
88
}
99
if (!common.opensslCli) {
1010
console.log('1..0 # Skipped: node compiled without OpenSSL CLI.');

test/parallel/test-tls-sni-option.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
if (!process.features.tls_sni) {
33
console.log('1..0 # Skipped: node compiled without OpenSSL or ' +
44
'with old OpenSSL version.');
5-
process.exit(0);
5+
return;
66
}
77

88
var common = require('../common'),

test/parallel/test-tls-sni-server-client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
if (!process.features.tls_sni) {
33
console.log('1..0 # Skipped: node compiled without OpenSSL or ' +
44
'with old OpenSSL version.');
5-
process.exit(0);
5+
return;
66
}
77

88
var common = require('../common'),

test/pummel/test-crypto-dh.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ var assert = require('assert');
55
try {
66
var crypto = require('crypto');
77
} catch (e) {
8-
console.log('Not compiled with OPENSSL support.');
9-
process.exit();
8+
console.log('1..0 # Skipped: node compiled without OpenSSL.');
9+
return;
1010
}
1111

1212
assert.throws(function() {

test/sequential/test-regress-GH-3542.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ var common = require('../common'),
77

88
// This test is only relevant on Windows.
99
if (!common.isWindows) {
10-
return process.exit(0);
10+
console.log('1..0 # Skipped: Windows specific test.');
11+
return;
1112
}
1213

1314
function test(p) {

0 commit comments

Comments
 (0)