Skip to content

Commit

Permalink
test: changing process.exit to return while skipping tests
Browse files Browse the repository at this point in the history
This patch uses `return` statement to skip the test instead of using
`process.exit` call.

PR-URL: #2109
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
  • Loading branch information
thefourtheye committed Jul 20, 2015
1 parent 69298d3 commit 79c865a
Show file tree
Hide file tree
Showing 151 changed files with 165 additions and 165 deletions.
2 changes: 1 addition & 1 deletion test/internet/test-http-https-default-ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var https = require('https');

Expand Down
2 changes: 1 addition & 1 deletion test/internet/test-tls-connnect-cnnic.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var common = require('../common');
if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}

var tls = require('tls');
Expand Down
2 changes: 1 addition & 1 deletion test/internet/test-tls-connnect-melissadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var common = require('../common');
if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}

var tls = require('tls');
Expand Down
2 changes: 1 addition & 1 deletion test/internet/test-tls-reuse-host-from-socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var tls = require('tls');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-bind-privileged-port.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var net = require('net');

if (process.platform === 'win32') {
console.log('1..0 # Skipped: not reliable on Windows.');
process.exit(0);
return;
}

if (process.getuid() === 0) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-disconnect-unshared-udp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
if (process.platform === 'win32') {
console.log('1..0 # Skipped: on windows, because clustered dgram is ENOTSUP');
process.exit(0);
return;
}

var cluster = require('cluster');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ var net = require('net');

if (process.platform === 'win32') {
console.log('1..0 # Skipped: not reliable on Windows');
process.exit(0);
return;
}

if (process.getuid() === 0) {
console.log('1..0 # Skipped: as this test should not be run as `root`');
process.exit(0);
return;
}

if (cluster.isMaster) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-authenticated.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-binary-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var constants = require('constants');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');
var tls = require('tls');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-cipher-decipher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-dh-odd-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-dh.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var constants = require('constants');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var domain = require('domain');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-domains.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var errors = 0;

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-ecb.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-from-binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-hash-stream-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var path = require('path');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-hmac.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-padding-aes256.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-padding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-pbkdf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-random.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-rsa-dsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var constants = require('constants');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-sign-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var fs = require('fs');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var util = require('util');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-verify-failure.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');
var tls = require('tls');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var util = require('util');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var crypto = require('crypto');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-dgram-bind-default-address.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var dgram = require('dgram');
// skip test in FreeBSD jails since 0.0.0.0 will resolve to default interface
if (common.inFreeBSDJail) {
console.log('1..0 # Skipped: In a FreeBSD jail');
process.exit();
return;
}

dgram.createSocket('udp4').bind(common.PORT + 0, common.mustCall(function() {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfile-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var path = require('path');
// the directory there.
if (process.platform === 'freebsd') {
console.log('1..0 # Skipped: platform not supported.');
process.exit();
return;
}

var callbacks = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfile-pipe-large.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var path = require('path');

if (process.platform === 'win32') {
console.log('1..0 # Skipped: No /dev/stdin on windows.');
process.exit();
return;
}

var fs = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfile-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var assert = require('assert');

if (process.platform === 'win32') {
console.log('1..0 # Skipped: No /dev/stdin on windows.');
process.exit();
return;
}

var fs = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-readfilesync-pipe-large.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var path = require('path');

if (process.platform === 'win32') {
console.log('1..0 # Skipped: No /dev/stdin on windows.');
process.exit();
return;
}

var fs = require('fs');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-curl-chunk-problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var common = require('../common');
var assert = require('assert');
if (!common.opensslCli) {
console.log('1..0 # Skipped: node compiled without OpenSSL CLI.');
process.exit(0);
return;
}

// http://groups.google.com/group/nodejs/browse_thread/thread/f66cd3c960406919
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-localaddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var http = require('http'),

if (!common.hasMultiLocalhost()) {
console.log('1..0 # Skipped: platform-specific test.');
process.exit();
return;
}

var server = http.createServer(function(req, res) {
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-url.parse-https.request.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var https = require('https');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-agent-servername.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}

var https = require('https');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var https = require('https');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-byteswritten.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var http = require('http');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var https = require('https');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-client-checkServerIdentity.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var https = require('https');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-client-get-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var https = require('https');

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-client-reject.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');

if (!common.hasCrypto) {
console.log('1..0 # Skipped: missing crypto');
process.exit();
return;
}
var https = require('https');

Expand Down
Loading

0 comments on commit 79c865a

Please sign in to comment.