Browse Source

test: simplify test skipping

* Make common.skip() exit.

  Also add common.printSkipMessage() for partial skips.

* Don't make needless things before skip

PR-URL: https://github.com/nodejs/node/pull/14021
Fixes: https://github.com/nodejs/node/issues/14016
Reviewed-By: Refael Ackermann <refack@gmail.com>
v6
Vse Mozhet Byt 8 years ago
parent
commit
2d2986ae72
  1. 8
      test/abort/test-abort-backtrace.js
  2. 8
      test/addons/load-long-path/test.js
  3. 5
      test/addons/openssl-binding/test.js
  4. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js
  5. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js
  6. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js
  7. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js
  8. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js
  9. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js
  10. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js
  11. 15
      test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js
  12. 1
      test/addons/symlinked-module/test.js
  13. 10
      test/async-hooks/test-connection.ssl.js
  14. 5
      test/async-hooks/test-crypto-pbkdf2.js
  15. 5
      test/async-hooks/test-crypto-randomBytes.js
  16. 10
      test/async-hooks/test-graph.connection.js
  17. 9
      test/async-hooks/test-graph.shutdown.js
  18. 9
      test/async-hooks/test-graph.tcp.js
  19. 16
      test/async-hooks/test-graph.tls-write.js
  20. 9
      test/async-hooks/test-tcpwrap.js
  21. 10
      test/async-hooks/test-tlswrap.js
  22. 10
      test/async-hooks/test-ttywrap.writestream.js
  23. 10
      test/async-hooks/test-writewrap.js
  24. 7
      test/common/README.md
  25. 8
      test/common/index.js
  26. 9
      test/doctool/test-doctool-html.js
  27. 9
      test/doctool/test-doctool-json.js
  28. 9
      test/fixtures/tls-connect.js
  29. 6
      test/inspector/test-inspector-ip-detection.js
  30. 8
      test/internet/test-dgram-broadcast-multi-process.js
  31. 10
      test/internet/test-dgram-multicast-multi-process.js
  32. 8
      test/internet/test-dns-ipv6.js
  33. 5
      test/internet/test-http-https-default-ports.js
  34. 4
      test/internet/test-tls-add-ca-cert.js
  35. 4
      test/internet/test-tls-connnect-melissadata.js
  36. 5
      test/internet/test-tls-reuse-host-from-socket.js
  37. 1
      test/known_issues/test-cwd-enoent-file.js
  38. 4
      test/parallel/test-async-wrap-GH13045.js
  39. 5
      test/parallel/test-async-wrap-uncaughtexception.js
  40. 8
      test/parallel/test-benchmark-crypto.js
  41. 2
      test/parallel/test-buffer-alloc.js
  42. 8
      test/parallel/test-child-process-fork-dgram.js
  43. 2
      test/parallel/test-cli-node-options.js
  44. 16
      test/parallel/test-cluster-bind-privileged-port.js
  45. 9
      test/parallel/test-cluster-dgram-1.js
  46. 9
      test/parallel/test-cluster-dgram-2.js
  47. 8
      test/parallel/test-cluster-dgram-reuse.js
  48. 8
      test/parallel/test-cluster-disconnect-race.js
  49. 4
      test/parallel/test-cluster-disconnect-unshared-udp.js
  50. 9
      test/parallel/test-cluster-http-pipe.js
  51. 16
      test/parallel/test-cluster-shared-handle-bind-privileged-port.js
  52. 12
      test/parallel/test-crypto-authenticated.js
  53. 4
      test/parallel/test-crypto-binary-default.js
  54. 8
      test/parallel/test-crypto-certificate.js
  55. 10
      test/parallel/test-crypto-cipher-decipher.js
  56. 8
      test/parallel/test-crypto-cipheriv-decipheriv.js
  57. 8
      test/parallel/test-crypto-deprecated.js
  58. 8
      test/parallel/test-crypto-dh-odd-key.js
  59. 9
      test/parallel/test-crypto-dh.js
  60. 8
      test/parallel/test-crypto-domain.js
  61. 11
      test/parallel/test-crypto-domains.js
  62. 13
      test/parallel/test-crypto-ecb.js
  63. 4
      test/parallel/test-crypto-engine.js
  64. 8
      test/parallel/test-crypto-fips.js
  65. 8
      test/parallel/test-crypto-from-binary.js
  66. 4
      test/parallel/test-crypto-hash-stream-pipe.js
  67. 8
      test/parallel/test-crypto-hash.js
  68. 8
      test/parallel/test-crypto-hmac.js
  69. 5
      test/parallel/test-crypto-lazy-transform-writable.js
  70. 8
      test/parallel/test-crypto-padding-aes256.js
  71. 8
      test/parallel/test-crypto-padding.js
  72. 5
      test/parallel/test-crypto-pbkdf2.js
  73. 5
      test/parallel/test-crypto-random.js
  74. 10
      test/parallel/test-crypto-rsa-dsa.js
  75. 12
      test/parallel/test-crypto-sign-verify.js
  76. 8
      test/parallel/test-crypto-stream.js
  77. 5
      test/parallel/test-crypto-verify-failure.js
  78. 4
      test/parallel/test-crypto.js
  79. 10
      test/parallel/test-cwd-enoent-preload.js
  80. 10
      test/parallel/test-cwd-enoent-repl.js
  81. 10
      test/parallel/test-cwd-enoent.js
  82. 8
      test/parallel/test-debug-usage.js
  83. 12
      test/parallel/test-dgram-bind-default-address.js
  84. 8
      test/parallel/test-dgram-cluster-close-during-bind.js
  85. 4
      test/parallel/test-dgram-send-empty-array.js
  86. 7
      test/parallel/test-dgram-send-empty-buffer.js
  87. 7
      test/parallel/test-dgram-send-empty-packet.js
  88. 8
      test/parallel/test-dgram-udp6-send-default-host.js
  89. 4
      test/parallel/test-dh-padding.js
  90. 4
      test/parallel/test-domain-crypto.js
  91. 7
      test/parallel/test-dsa-fips-invalid-key.js
  92. 8
      test/parallel/test-fs-long-path.js
  93. 8
      test/parallel/test-fs-read-file-sync-hostname.js
  94. 8
      test/parallel/test-fs-readdir-ucs2.js
  95. 12
      test/parallel/test-fs-readfile-error.js
  96. 8
      test/parallel/test-fs-readfile-pipe-large.js
  97. 6
      test/parallel/test-fs-readfile-pipe.js
  98. 8
      test/parallel/test-fs-readfilesync-pipe-large.js
  99. 11
      test/parallel/test-fs-realpath-on-substed-drive.js
  100. 4
      test/parallel/test-fs-realpath-pipe.js

8
test/abort/test-abort-backtrace.js

@ -1,13 +1,11 @@
'use strict';
const common = require('../common');
if (common.isWindows)
common.skip('Backtraces unimplemented on Windows.');
const assert = require('assert');
const cp = require('child_process');
if (common.isWindows) {
common.skip('Backtraces unimplemented on Windows.');
return;
}
if (process.argv[2] === 'child') {
process.abort();
} else {

8
test/addons/load-long-path/test.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
if (common.isWOW64)
common.skip('doesn\'t work on WOW64');
const fs = require('fs');
const path = require('path');
const assert = require('assert');
if (common.isWOW64) {
common.skip('doesn\'t work on WOW64');
return;
}
common.refreshTmpDir();
// make a path that is more than 260 chars long.

5
test/addons/openssl-binding/test.js

@ -1,10 +1,9 @@
'use strict';
const common = require('../../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
process.exit(0);
}
const assert = require('assert');
const binding = require(`./build/${common.buildType}/binding`);
const bytes = new Uint8Array(1024);

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js

@ -1,6 +1,10 @@
'use strict';
const common = require('../../common');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem)
common.skip(skipMessage);
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
@ -8,12 +12,6 @@ const assert = require('assert');
// v8::String::kMaxLength defined in v8.h
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
common.skip(skipMessage);
return;
}
let buf;
try {
buf = Buffer.allocUnsafe(kStringMaxLength);
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
const maxString = buf.toString('latin1');
assert.strictEqual(maxString.length, kStringMaxLength);

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
if (!common.enoughTestMem)
common.skip(skipMessage);
return;
}
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
// v8 fails silently if string length > v8::String::kMaxLength
// v8::String::kMaxLength defined in v8.h
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
assert.throws(function() {
buf.toString('ascii');

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
if (!common.enoughTestMem)
common.skip(skipMessage);
return;
}
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
// v8 fails silently if string length > v8::String::kMaxLength
// v8::String::kMaxLength defined in v8.h
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
assert.throws(function() {
buf.toString('base64');

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
if (!common.enoughTestMem)
common.skip(skipMessage);
return;
}
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
// v8 fails silently if string length > v8::String::kMaxLength
// v8::String::kMaxLength defined in v8.h
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
assert.throws(function() {
buf.toString('latin1');

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
if (!common.enoughTestMem)
common.skip(skipMessage);
return;
}
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
// v8 fails silently if string length > v8::String::kMaxLength
// v8::String::kMaxLength defined in v8.h
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
assert.throws(function() {
buf.toString('hex');

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
if (!common.enoughTestMem)
common.skip(skipMessage);
return;
}
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
// v8 fails silently if string length > v8::String::kMaxLength
// v8::String::kMaxLength defined in v8.h
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
assert.throws(function() {
buf.toString();

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
if (!common.enoughTestMem)
common.skip(skipMessage);
return;
}
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
// v8 fails silently if string length > v8::String::kMaxLength
// v8::String::kMaxLength defined in v8.h
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
const maxString = buf.toString('utf16le');
assert.strictEqual(maxString.length, (kStringMaxLength + 2) / 2);

15
test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../../common');
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
const skipMessage = 'intensive toString tests due to memory confinements';
if (!common.enoughTestMem) {
if (!common.enoughTestMem)
common.skip(skipMessage);
return;
}
const binding = require(`./build/${common.buildType}/binding`);
const assert = require('assert');
// v8 fails silently if string length > v8::String::kMaxLength
// v8::String::kMaxLength defined in v8.h
@ -21,14 +19,11 @@ try {
// If the exception is not due to memory confinement then rethrow it.
if (e.message !== 'Array buffer allocation failed') throw (e);
common.skip(skipMessage);
return;
}
// Ensure we have enough memory available for future allocations to succeed.
if (!binding.ensureAllocation(2 * kStringMaxLength)) {
if (!binding.ensureAllocation(2 * kStringMaxLength))
common.skip(skipMessage);
return;
}
assert.throws(function() {
buf.toString('utf16le');

1
test/addons/symlinked-module/test.js

@ -22,7 +22,6 @@ try {
} catch (err) {
if (err.code !== 'EPERM') throw err;
common.skip('module identity test (no privs for symlinks)');
return;
}
const sub = require('./submodule');

10
test/async-hooks/test-connection.ssl.js

@ -1,16 +1,14 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const initHooks = require('./init-hooks');
const tick = require('./tick');
const common = require('../common');
const assert = require('assert');
const { checkInvocations } = require('./hook-checks');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const tls = require('tls');
const Connection = process.binding('crypto').Connection;
const hooks = initHooks();

5
test/async-hooks/test-crypto-pbkdf2.js

@ -1,10 +1,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const tick = require('./tick');
const initHooks = require('./init-hooks');

5
test/async-hooks/test-crypto-randomBytes.js

@ -1,10 +1,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const tick = require('./tick');
const initHooks = require('./init-hooks');

10
test/async-hooks/test-graph.connection.js

@ -1,13 +1,11 @@
'use strict';
const initHooks = require('./init-hooks');
const common = require('../common');
const verifyGraph = require('./verify-graph');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
const tls = require('tls');
const Connection = process.binding('crypto').Connection;

9
test/async-hooks/test-graph.shutdown.js

@ -1,14 +1,11 @@
'use strict';
const common = require('../common');
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
if (!common.hasIPv6) {
if (!common.hasIPv6)
common.skip('IPv6 support required');
return;
}
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
const net = require('net');
const hooks = initHooks();

9
test/async-hooks/test-graph.tcp.js

@ -1,14 +1,11 @@
'use strict';
const common = require('../common');
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
if (!common.hasIPv6) {
if (!common.hasIPv6)
common.skip('IPv6 support required');
return;
}
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
const net = require('net');
const hooks = initHooks();

16
test/async-hooks/test-graph.tls-write.js

@ -1,21 +1,17 @@
'use strict';
const common = require('../common');
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
const fs = require('fs');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
if (!common.hasIPv6) {
if (!common.hasIPv6)
common.skip('IPv6 support required');
return;
}
const initHooks = require('./init-hooks');
const verifyGraph = require('./verify-graph');
const fs = require('fs');
const tls = require('tls');
const hooks = initHooks();
hooks.enable();

9
test/async-hooks/test-tcpwrap.js

@ -2,16 +2,13 @@
'use strict';
const common = require('../common');
if (!common.hasIPv6)
common.skip('IPv6 support required');
const assert = require('assert');
const tick = require('./tick');
const initHooks = require('./init-hooks');
const { checkInvocations } = require('./hook-checks');
if (!common.hasIPv6) {
common.skip('IPv6 support required');
return;
}
const net = require('net');
let tcp1, tcp2, tcp3;

10
test/async-hooks/test-tlswrap.js

@ -1,18 +1,16 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const tick = require('./tick');
const initHooks = require('./init-hooks');
const fs = require('fs');
const { checkInvocations } = require('./hook-checks');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const tls = require('tls');
const hooks = initHooks();
hooks.enable();

10
test/async-hooks/test-ttywrap.writestream.js

@ -1,14 +1,16 @@
'use strict';
const common = require('../common');
const tty_fd = common.getTTYfd();
if (tty_fd < 0)
common.skip('no valid TTY fd available');
const assert = require('assert');
const tick = require('./tick');
const initHooks = require('./init-hooks');
const { checkInvocations } = require('./hook-checks');
const tty_fd = common.getTTYfd();
if (tty_fd < 0)
return common.skip('no valid TTY fd available');
const ttyStream = (() => {
try {
return new (require('tty').WriteStream)(tty_fd);
@ -17,7 +19,7 @@ const ttyStream = (() => {
}
})();
if (ttyStream === null)
return common.skip('no valid TTY fd available');
common.skip('no valid TTY fd available');
const hooks = initHooks();
hooks.enable();

10
test/async-hooks/test-writewrap.js

@ -1,17 +1,15 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const initHooks = require('./init-hooks');
const fs = require('fs');
const { checkInvocations } = require('./hook-checks');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const tls = require('tls');
const hooks = initHooks();
hooks.enable();

7
test/common/README.md

@ -264,6 +264,11 @@ Path to the test sock.
Port tests are running on.
### printSkipMessage(msg)
* `msg` [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
Logs '1..0 # Skipped: ' + `msg`
### refreshTmpDir
* return [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
@ -285,7 +290,7 @@ Path to the 'root' directory. either `/` or `c:\\` (windows)
### skip(msg)
* `msg` [&lt;String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)
Logs '1..0 # Skipped: ' + `msg`
Logs '1..0 # Skipped: ' + `msg` and exits with exit code `0`.
### spawnPwd(options)
* `options` [&lt;Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)

8
test/common/index.js

@ -570,10 +570,15 @@ exports.mustNotCall = function(msg) {
};
};
exports.skip = function(msg) {
exports.printSkipMessage = function(msg) {
console.log(`1..0 # Skipped: ${msg}`);
};
exports.skip = function(msg) {
exports.printSkipMessage(msg);
process.exit(0);
};
// A stream to push an array into a REPL
function ArrayStream() {
this.run = function(data) {
@ -717,7 +722,6 @@ exports.expectsError = function expectsError({code, type, message}) {
exports.skipIfInspectorDisabled = function skipIfInspectorDisabled() {
if (process.config.variables.v8_enable_inspector === 0) {
exports.skip('V8 inspector is disabled');
process.exit(0);
}
};

9
test/doctool/test-doctool-html.js

@ -1,17 +1,16 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
// The doctool currently uses js-yaml from the tool/eslint/ tree.
try {
require('../../tools/eslint/node_modules/js-yaml');
} catch (e) {
return common.skip('missing js-yaml (eslint not present)');
common.skip('missing js-yaml (eslint not present)');
}
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const processIncludes = require('../../tools/doc/preprocess.js');
const html = require('../../tools/doc/html.js');

9
test/doctool/test-doctool-json.js

@ -1,17 +1,16 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
// The doctool currently uses js-yaml from the tool/eslint/ tree.
try {
require('../../tools/eslint/node_modules/js-yaml');
} catch (e) {
return common.skip('missing js-yaml (eslint not present)');
common.skip('missing js-yaml (eslint not present)');
}
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const json = require('../../tools/doc/json.js');
// Outputs valid json with the expected fields when given simple markdown

9
test/fixtures/tls-connect.js

@ -4,14 +4,13 @@
'use strict';
const common = require('../common');
const fs = require('fs');
const join = require('path').join;
// Check if Node was compiled --without-ssl and if so exit early
// as the require of tls will otherwise throw an Error.
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
process.exit(0);
}
const fs = require('fs');
const join = require('path').join;
const tls = require('tls');
const util = require('util');

6
test/inspector/test-inspector-ip-detection.js

@ -9,10 +9,8 @@ const os = require('os');
const ip = pickIPv4Address();
if (!ip) {
if (!ip)
common.skip('No IP address found');
return;
}
function checkListResponse(instance, err, response) {
assert.ifError(err);
@ -29,7 +27,7 @@ function checkListResponse(instance, err, response) {
function checkError(instance, error) {
// Some OSes will not allow us to connect
if (error.code === 'EHOSTUNREACH') {
common.skip('Unable to connect to self');
common.printSkipMessage('Unable to connect to self');
} else {
throw error;
}

8
test/internet/test-dgram-broadcast-multi-process.js

@ -21,6 +21,9 @@
'use strict';
const common = require('../common');
if (common.inFreeBSDJail)
common.skip('in a FreeBSD jail');
const assert = require('assert');
const dgram = require('dgram');
const util = require('util');
@ -35,11 +38,6 @@ const messages = [
Buffer.from('Fourth message to send')
];
if (common.inFreeBSDJail) {
common.skip('in a FreeBSD jail');
return;
}
let bindAddress = null;
// Take the first non-internal interface as the address for binding.

10
test/internet/test-dgram-multicast-multi-process.js

@ -21,6 +21,10 @@
'use strict';
const common = require('../common');
// Skip test in FreeBSD jails.
if (common.inFreeBSDJail)
common.skip('In a FreeBSD jail');
const assert = require('assert');
const dgram = require('dgram');
const fork = require('child_process').fork;
@ -37,12 +41,6 @@ const listeners = 3;
let listening, sendSocket, done, timer, dead;
// Skip test in FreeBSD jails.
if (common.inFreeBSDJail) {
common.skip('In a FreeBSD jail');
return;
}
function launchChildProcess() {
const worker = fork(__filename, ['child']);
workers[worker.pid] = worker;

8
test/internet/test-dns-ipv6.js

@ -1,5 +1,8 @@
'use strict';
const common = require('../common');
if (!common.hasIPv6)
common.skip('this test, no IPv6 support');
const assert = require('assert');
const dns = require('dns');
const net = require('net');
@ -8,11 +11,6 @@ const isIPv6 = net.isIPv6;
let running = false;
const queue = [];
if (!common.hasIPv6) {
common.skip('this test, no IPv6 support');
return;
}
function TEST(f) {
function next() {
const f = queue.shift();

5
test/internet/test-http-https-default-ports.js

@ -22,10 +22,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const https = require('https');
const http = require('http');

4
test/internet/test-tls-add-ca-cert.js

@ -1,10 +1,8 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
// Test interaction of compiled-in CAs with user-provided CAs.

4
test/internet/test-tls-connnect-melissadata.js

@ -3,10 +3,8 @@
// certification between Starfield Class 2 and ValiCert Class 2
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const tls = require('tls');
const socket = tls.connect(443, 'address.melissadata.net', function() {

5
test/internet/test-tls-reuse-host-from-socket.js

@ -22,10 +22,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const tls = require('tls');
const net = require('net');

1
test/known_issues/test-cwd-enoent-file.js

@ -9,7 +9,6 @@ if (common.isSunOS || common.isWindows || common.isAix) {
// The current working directory cannot be removed on these platforms.
// Change this to common.skip() when this is no longer a known issue test.
assert.fail('cannot rmdir current working directory');
return;
}
const cp = require('child_process');

4
test/parallel/test-async-wrap-GH13045.js

@ -1,9 +1,7 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
// Refs: https://github.com/nodejs/node/issues/13045
// An HTTP Agent reuses a TLSSocket, and makes a failed call to `asyncReset`.

5
test/parallel/test-async-wrap-uncaughtexception.js

@ -1,10 +1,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const async_hooks = require('async_hooks');
const call_log = [0, 0, 0, 0]; // [before, callback, exception, after];

8
test/parallel/test-benchmark-crypto.js

@ -2,15 +2,11 @@
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
if (common.hasFipsCrypto) {
if (common.hasFipsCrypto)
common.skip('some benchmarks are FIPS-incompatible');
return;
}
// Minimal test for crypto benchmarks. This makes sure the benchmarks aren't
// horribly broken but nothing more than that.

2
test/parallel/test-buffer-alloc.js

@ -917,7 +917,7 @@ if (common.hasCrypto) {
crypto.createHash('sha1').update(b2).digest('hex')
);
} else {
common.skip('missing crypto');
common.printSkipMessage('missing crypto');
}
const ps = Buffer.poolSize;

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

@ -28,15 +28,13 @@
*/
const common = require('../common');
if (common.isWindows)
common.skip('Sending dgram sockets to child processes is not supported');
const dgram = require('dgram');
const fork = require('child_process').fork;
const assert = require('assert');
if (common.isWindows) {
common.skip('Sending dgram sockets to child processes is not supported');
return;
}
if (process.argv[2] === 'child') {
let childServer;

2
test/parallel/test-cli-node-options.js

@ -1,7 +1,7 @@
'use strict';
const common = require('../common');
if (process.config.variables.node_without_node_options)
return common.skip('missing NODE_OPTIONS support');
common.skip('missing NODE_OPTIONS support');
// Test options specified by env variable.

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

@ -21,19 +21,15 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');
const net = require('net');
if (common.isWindows) {
if (common.isWindows)
common.skip('not reliable on Windows.');
return;
}
if (process.getuid() === 0) {
if (process.getuid() === 0)
common.skip('Test is not supposed to be run as root.');
return;
}
const assert = require('assert');
const cluster = require('cluster');
const net = require('net');
if (cluster.isMaster) {
cluster.fork().on('exit', common.mustCall((exitCode) => {

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

@ -21,6 +21,9 @@
'use strict';
const common = require('../common');
if (common.isWindows)
common.skip('dgram clustering is currently not supported on Windows.');
const NUM_WORKERS = 4;
const PACKETS_PER_WORKER = 10;
@ -28,12 +31,6 @@ const assert = require('assert');
const cluster = require('cluster');
const dgram = require('dgram');
if (common.isWindows) {
common.skip('dgram clustering is currently not supported on Windows.');
return;
}
if (cluster.isMaster)
master();
else

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

@ -21,6 +21,9 @@
'use strict';
const common = require('../common');
if (common.isWindows)
common.skip('dgram clustering is currently not supported on Windows.');
const NUM_WORKERS = 4;
const PACKETS_PER_WORKER = 10;
@ -28,12 +31,6 @@ const cluster = require('cluster');
const dgram = require('dgram');
const assert = require('assert');
if (common.isWindows) {
common.skip('dgram clustering is currently not supported on Windows.');
return;
}
if (cluster.isMaster)
master();
else

8
test/parallel/test-cluster-dgram-reuse.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../common');
if (common.isWindows)
common.skip('dgram clustering is currently not supported on windows.');
const assert = require('assert');
const cluster = require('cluster');
const dgram = require('dgram');
if (common.isWindows) {
common.skip('dgram clustering is currently not supported on windows.');
return;
}
if (cluster.isMaster) {
cluster.fork().on('exit', common.mustCall((code) => {
assert.strictEqual(code, 0);

8
test/parallel/test-cluster-disconnect-race.js

@ -4,15 +4,13 @@
// Ref: https://github.com/nodejs/node/issues/4205
const common = require('../common');
if (common.isWindows)
common.skip('This test does not apply to Windows.');
const assert = require('assert');
const net = require('net');
const cluster = require('cluster');
if (common.isWindows) {
common.skip('This test does not apply to Windows.');
return;
}
cluster.schedulingPolicy = cluster.SCHED_NONE;
if (cluster.isMaster) {

4
test/parallel/test-cluster-disconnect-unshared-udp.js

@ -23,10 +23,8 @@
const common = require('../common');
if (common.isWindows) {
if (common.isWindows)
common.skip('on windows, because clustered dgram is ENOTSUP');
return;
}
const cluster = require('cluster');
const dgram = require('dgram');

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

@ -22,16 +22,15 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');
const http = require('http');
if (common.isWindows) {
common.skip(
'It is not possible to send pipe handles over the IPC pipe on Windows');
return;
}
const assert = require('assert');
const cluster = require('cluster');
const http = require('http');
if (cluster.isMaster) {
common.refreshTmpDir();
const worker = cluster.fork();

16
test/parallel/test-cluster-shared-handle-bind-privileged-port.js

@ -21,19 +21,15 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const cluster = require('cluster');
const net = require('net');
if (common.isWindows) {
if (common.isWindows)
common.skip('not reliable on Windows');
return;
}
if (process.getuid() === 0) {
if (process.getuid() === 0)
common.skip('as this test should not be run as `root`');
return;
}
const assert = require('assert');
const cluster = require('cluster');
const net = require('net');
if (cluster.isMaster) {
// Master opens and binds the socket and shares it with the worker.

12
test/parallel/test-crypto-authenticated.js

@ -21,12 +21,10 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
crypto.DEFAULT_ENCODING = 'buffer';
@ -341,12 +339,12 @@ for (const i in TEST_CASES) {
const test = TEST_CASES[i];
if (!ciphers.includes(test.algo)) {
common.skip(`unsupported ${test.algo} test`);
common.printSkipMessage(`unsupported ${test.algo} test`);
continue;
}
if (common.hasFipsCrypto && test.iv.length < 24) {
common.skip('IV len < 12 bytes unsupported in FIPS mode');
common.printSkipMessage('IV len < 12 bytes unsupported in FIPS mode');
continue;
}

4
test/parallel/test-crypto-binary-default.js

@ -26,10 +26,8 @@
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');

8
test/parallel/test-crypto-certificate.js

@ -21,12 +21,10 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
crypto.DEFAULT_ENCODING = 'buffer';

10
test/parallel/test-crypto-cipher-decipher.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
if (common.hasFipsCrypto) {
if (common.hasFipsCrypto)
common.skip('not supported in FIPS mode');
return;
}
const crypto = require('crypto');
const assert = require('assert');

8
test/parallel/test-crypto-cipheriv-decipheriv.js

@ -1,11 +1,9 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
function testCipher1(key, iv) {

8
test/parallel/test-crypto-deprecated.js

@ -1,11 +1,9 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
const tls = require('tls');

8
test/parallel/test-crypto-dh-odd-key.js

@ -21,12 +21,10 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
function test() {

9
test/parallel/test-crypto-dh.js

@ -1,12 +1,11 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
const DH_NOT_SUITABLE_GENERATOR = crypto.constants.DH_NOT_SUITABLE_GENERATOR;
// Test Diffie-Hellman with two parties sharing a secret,

8
test/parallel/test-crypto-domain.js

@ -21,13 +21,11 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const domain = require('domain');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const crypto = require('crypto');
function test(fn) {

11
test/parallel/test-crypto-domains.js

@ -21,17 +21,16 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const domain = require('domain');
const assert = require('assert');
const crypto = require('crypto');
const d = domain.create();
const expect = ['pbkdf2', 'randomBytes', 'pseudoRandomBytes'];
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const crypto = require('crypto');
d.on('error', common.mustCall(function(e) {
assert.strictEqual(e.message, expect.shift());
}, 3));

13
test/parallel/test-crypto-ecb.js

@ -21,16 +21,13 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
if (common.hasFipsCrypto) {
if (common.hasFipsCrypto)
common.skip('BF-ECB is not FIPS 140-2 compatible');
return;
}
const assert = require('assert');
const crypto = require('crypto');
crypto.DEFAULT_ENCODING = 'buffer';

4
test/parallel/test-crypto-engine.js

@ -1,10 +1,8 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');

8
test/parallel/test-crypto-fips.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const spawnSync = require('child_process').spawnSync;
const path = require('path');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const FIPS_ENABLED = 1;
const FIPS_DISABLED = 0;
const FIPS_ERROR_STRING = 'Error: Cannot set FIPS mode';

8
test/parallel/test-crypto-from-binary.js

@ -25,12 +25,10 @@
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
const EXTERN_APEX = 0xFBEE9;

4
test/parallel/test-crypto-hash-stream-pipe.js

@ -22,10 +22,8 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');

8
test/parallel/test-crypto-hash.js

@ -1,13 +1,11 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const crypto = require('crypto');
// Test hashing

8
test/parallel/test-crypto-hmac.js

@ -1,11 +1,9 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
// Test for binding layer robustness

5
test/parallel/test-crypto-lazy-transform-writable.js

@ -1,10 +1,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
const Stream = require('stream');

8
test/parallel/test-crypto-padding-aes256.js

@ -21,12 +21,10 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
crypto.DEFAULT_ENCODING = 'buffer';

8
test/parallel/test-crypto-padding.js

@ -21,12 +21,10 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');
crypto.DEFAULT_ENCODING = 'buffer';

5
test/parallel/test-crypto-pbkdf2.js

@ -1,10 +1,7 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');

5
test/parallel/test-crypto-random.js

@ -22,10 +22,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');

10
test/parallel/test-crypto-rsa-dsa.js

@ -1,15 +1,13 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const fs = require('fs');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const constants = require('crypto').constants;
const crypto = require('crypto');
const constants = crypto.constants;
const fixtDir = common.fixturesDir;
// Test certificates

12
test/parallel/test-crypto-sign-verify.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const fs = require('fs');
const path = require('path');
const exec = require('child_process').exec;
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const crypto = require('crypto');
// Test certificates
@ -245,10 +243,8 @@ const modSize = 1024;
// RSA-PSS Sign test by verifying with 'openssl dgst -verify'
{
if (!common.opensslCli) {
if (!common.opensslCli)
common.skip('node compiled without OpenSSL CLI.');
return;
}
const pubfile = path.join(common.fixturesDir, 'keys/rsa_public_2048.pem');
const privfile = path.join(common.fixturesDir, 'keys/rsa_private_2048.pem');

8
test/parallel/test-crypto-stream.js

@ -21,14 +21,12 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const stream = require('stream');
const util = require('util');
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const crypto = require('crypto');
// Small stream to buffer converter

5
test/parallel/test-crypto-verify-failure.js

@ -22,10 +22,9 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const crypto = require('crypto');
const tls = require('tls');

4
test/parallel/test-crypto.js

@ -22,10 +22,8 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('missing crypto');
return;
}
const assert = require('assert');
const crypto = require('crypto');

10
test/parallel/test-cwd-enoent-preload.js

@ -1,15 +1,13 @@
'use strict';
const common = require('../common');
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAix)
common.skip('cannot rmdir current working directory');
const assert = require('assert');
const fs = require('fs');
const spawn = require('child_process').spawn;
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAix) {
common.skip('cannot rmdir current working directory');
return;
}
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
const abspathFile = require('path').join(common.fixturesDir, 'a.js');
common.refreshTmpDir();

10
test/parallel/test-cwd-enoent-repl.js

@ -1,15 +1,13 @@
'use strict';
const common = require('../common');
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAix)
common.skip('cannot rmdir current working directory');
const assert = require('assert');
const fs = require('fs');
const spawn = require('child_process').spawn;
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAix) {
common.skip('cannot rmdir current working directory');
return;
}
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
common.refreshTmpDir();
fs.mkdirSync(dirname);

10
test/parallel/test-cwd-enoent.js

@ -1,15 +1,13 @@
'use strict';
const common = require('../common');
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAix)
common.skip('cannot rmdir current working directory');
const assert = require('assert');
const fs = require('fs');
const spawn = require('child_process').spawn;
// Fails with EINVAL on SmartOS, EBUSY on Windows, EBUSY on AIX.
if (common.isSunOS || common.isWindows || common.isAix) {
common.skip('cannot rmdir current working directory');
return;
}
const dirname = `${common.tmpDir}/cwd-does-not-exist-${process.pid}`;
common.refreshTmpDir();
fs.mkdirSync(dirname);

8
test/parallel/test-debug-usage.js

@ -1,13 +1,11 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const spawn = require('child_process').spawn;
if (!common.hasCrypto) {
common.skip('missing crypto');
return;
}
const child = spawn(process.execPath, ['debug']);
child.stderr.setEncoding('utf8');

12
test/parallel/test-dgram-bind-default-address.js

@ -21,14 +21,12 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const dgram = require('dgram');
// skip test in FreeBSD jails since 0.0.0.0 will resolve to default interface
if (common.inFreeBSDJail) {
if (common.inFreeBSDJail)
common.skip('In a FreeBSD jail');
return;
}
const assert = require('assert');
const dgram = require('dgram');
dgram.createSocket('udp4').bind(0, common.mustCall(function() {
assert.strictEqual(typeof this.address().port, 'number');
@ -39,7 +37,7 @@ dgram.createSocket('udp4').bind(0, common.mustCall(function() {
}));
if (!common.hasIPv6) {
common.skip('udp6 part of test, because no IPv6 support');
common.printSkipMessage('udp6 part of test, because no IPv6 support');
return;
}

8
test/parallel/test-dgram-cluster-close-during-bind.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../common');
if (common.isWindows)
common.skip('dgram clustering is currently not supported on windows.');
const assert = require('assert');
const cluster = require('cluster');
const dgram = require('dgram');
if (common.isWindows) {
common.skip('dgram clustering is currently not supported on windows.');
return;
}
if (cluster.isMaster) {
cluster.fork();
} else {

4
test/parallel/test-dgram-send-empty-array.js

@ -2,10 +2,8 @@
const common = require('../common');
if (common.isOSX) {
if (common.isOSX)
common.skip('because of 17894467 Apple bug');
return;
}
const assert = require('assert');
const dgram = require('dgram');

7
test/parallel/test-dgram-send-empty-buffer.js

@ -21,13 +21,10 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (common.isOSX) {
if (common.isOSX)
common.skip('because of 17894467 Apple bug');
return;
}
const assert = require('assert');
const dgram = require('dgram');
const client = dgram.createSocket('udp4');

7
test/parallel/test-dgram-send-empty-packet.js

@ -1,12 +1,9 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (common.isOSX) {
if (common.isOSX)
common.skip('because of 17894467 Apple bug');
return;
}
const assert = require('assert');
const dgram = require('dgram');
const client = dgram.createSocket('udp4');

8
test/parallel/test-dgram-udp6-send-default-host.js

@ -1,14 +1,12 @@
'use strict';
const common = require('../common');
if (!common.hasIPv6)
common.skip('no IPv6 support');
const assert = require('assert');
const dgram = require('dgram');
if (!common.hasIPv6) {
common.skip('no IPv6 support');
return;
}
const client = dgram.createSocket('udp6');
const toSend = [Buffer.alloc(256, 'x'),

4
test/parallel/test-dh-padding.js

@ -22,10 +22,8 @@
'use strict';
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('node compiled without OpenSSL.');
return;
}
const assert = require('assert');
const crypto = require('crypto');

4
test/parallel/test-domain-crypto.js

@ -23,10 +23,8 @@
const common = require('../common');
if (!common.hasCrypto) {
if (!common.hasCrypto)
common.skip('node compiled without OpenSSL.');
return;
}
const crypto = require('crypto');

7
test/parallel/test-dsa-fips-invalid-key.js

@ -1,12 +1,9 @@
'use strict';
const common = require('../common');
const assert = require('assert');
if (!common.hasFipsCrypto) {
if (!common.hasFipsCrypto)
common.skip('node compiled without FIPS OpenSSL.');
return;
}
const assert = require('assert');
const crypto = require('crypto');
const fs = require('fs');

8
test/parallel/test-fs-long-path.js

@ -21,15 +21,13 @@
'use strict';
const common = require('../common');
if (!common.isWindows)
common.skip('this test is Windows-specific.');
const fs = require('fs');
const path = require('path');
const assert = require('assert');
if (!common.isWindows) {
common.skip('this test is Windows-specific.');
return;
}
// make a path that will be at least 260 chars long.
const fileNameLen = Math.max(260 - common.tmpDir.length - 1, 1);
const fileName = path.join(common.tmpDir, 'x'.repeat(fileNameLen));

8
test/parallel/test-fs-read-file-sync-hostname.js

@ -21,14 +21,12 @@
'use strict';
const common = require('../common');
if (!common.isLinux)
common.skip('Test is linux specific.');
const assert = require('assert');
const fs = require('fs');
if (!common.isLinux) {
common.skip('Test is linux specific.');
return;
}
// Test to make sure reading a file under the /proc directory works. See:
// https://groups.google.com/forum/#!topic/nodejs-dev/rxZ_RoH1Gn0
const hostname = fs.readFileSync('/proc/sys/kernel/hostname');

8
test/parallel/test-fs-readdir-ucs2.js

@ -1,15 +1,13 @@
'use strict';
const common = require('../common');
if (!common.isLinux)
common.skip('Test is linux specific.');
const path = require('path');
const fs = require('fs');
const assert = require('assert');
if (!common.isLinux) {
common.skip('Test is linux specific.');
return;
}
common.refreshTmpDir();
const filename = '\uD83D\uDC04';
const root = Buffer.from(`${common.tmpDir}${path.sep}`);

12
test/parallel/test-fs-readfile-error.js

@ -21,16 +21,14 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const exec = require('child_process').exec;
const path = require('path');
// `fs.readFile('/')` does not fail on FreeBSD, because you can open and read
// the directory there.
if (common.isFreeBSD) {
if (common.isFreeBSD)
common.skip('platform not supported.');
return;
}
const assert = require('assert');
const exec = require('child_process').exec;
const path = require('path');
function test(env, cb) {
const filename = path.join(common.fixturesDir, 'test-fs-readfile-error.js');

8
test/parallel/test-fs-readfile-pipe-large.js

@ -1,15 +1,13 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const path = require('path');
// simulate `cat readfile.js | node readfile.js`
if (common.isWindows || common.isAix) {
if (common.isWindows || common.isAix)
common.skip(`No /dev/stdin on ${process.platform}.`);
return;
}
const assert = require('assert');
const path = require('path');
const fs = require('fs');
if (process.argv[2] === 'child') {

6
test/parallel/test-fs-readfile-pipe.js

@ -21,15 +21,13 @@
'use strict';
const common = require('../common');
const assert = require('assert');
// simulate `cat readfile.js | node readfile.js`
if (common.isWindows || common.isAix) {
if (common.isWindows || common.isAix)
common.skip(`No /dev/stdin on ${process.platform}.`);
return;
}
const assert = require('assert');
const fs = require('fs');
const dataExpected = fs.readFileSync(__filename, 'utf8');

8
test/parallel/test-fs-readfilesync-pipe-large.js

@ -1,15 +1,13 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const path = require('path');
// simulate `cat readfile.js | node readfile.js`
if (common.isWindows || common.isAix) {
if (common.isWindows || common.isAix)
common.skip(`No /dev/stdin on ${process.platform}.`);
return;
}
const assert = require('assert');
const path = require('path');
const fs = require('fs');
if (process.argv[2] === 'child') {

11
test/parallel/test-fs-realpath-on-substed-drive.js

@ -1,14 +1,13 @@
'use strict';
const common = require('../common');
if (!common.isWindows)
common.skip('Test for Windows only');
const assert = require('assert');
const fs = require('fs');
const spawnSync = require('child_process').spawnSync;
if (!common.isWindows) {
common.skip('Test for Windows only');
return;
}
let result;
// create a subst drive
@ -21,10 +20,8 @@ for (i = 0; i < driveLetters.length; ++i) {
if (result.status === 0)
break;
}
if (i === driveLetters.length) {
if (i === driveLetters.length)
common.skip('Cannot create subst drive');
return;
}
// schedule cleanup (and check if all callbacks where called)
process.on('exit', function() {

4
test/parallel/test-fs-realpath-pipe.js

@ -2,10 +2,8 @@
const common = require('../common');
if (common.isWindows || common.isAix) {
if (common.isWindows || common.isAix)
common.skip(`No /dev/stdin on ${process.platform}.`);
return;
}
const assert = require('assert');

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save