summaryrefslogtreecommitdiff
path: root/test/common/index.js
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2018-12-20 08:54:40 +0100
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-12-23 07:23:30 +0100
commit2a02b9df6ef35b34b7d93cf8408ce53fb2f66b53 (patch)
tree3a75699f502c3bcbf245e9ede43f5204183a590c /test/common/index.js
parent0c1a38821825d4aced001e223bbba23b19b521f1 (diff)
downloadandroid-node-v8-2a02b9df6ef35b34b7d93cf8408ce53fb2f66b53.tar.gz
android-node-v8-2a02b9df6ef35b34b7d93cf8408ce53fb2f66b53.tar.bz2
android-node-v8-2a02b9df6ef35b34b7d93cf8408ce53fb2f66b53.zip
test: add hasCrypto check to common flags check
Currently, if node is configured --without-ssl there will be a number of test errors related to crypto flags: Error: Test has to be started with the flag: '--tls-v1.1' This commit adds a hasCrypto check to the flags checking similar to what is done for --without-intl. PR-URL: https://github.com/nodejs/node/pull/25147 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/common/index.js')
-rw-r--r--test/common/index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/common/index.js b/test/common/index.js
index 5cd8a725b0..5ac79f4998 100644
--- a/test/common/index.js
+++ b/test/common/index.js
@@ -36,6 +36,8 @@ const {
const noop = () => {};
+const hasCrypto = Boolean(process.versions.openssl);
+
const isMainThread = (() => {
try {
return require('worker_threads').isMainThread;
@@ -73,6 +75,9 @@ if (process.argv.length === 2 &&
const args = process.execArgv.map((arg) => arg.replace(/_/g, '-'));
for (const flag of flags) {
if (!args.includes(flag) &&
+ // If the binary was built without-ssl then the crypto flags are
+ // invalid (bad option). The test itself should handle this case.
+ hasCrypto &&
// If the binary is build without `intl` the inspect option is
// invalid. The test itself should handle this case.
(process.config.variables.v8_enable_inspector !== 0 ||
@@ -105,7 +110,6 @@ const rootDir = isWindows ? 'c:\\' : '/';
const buildType = process.config.target_defaults.default_configuration;
-const hasCrypto = Boolean(process.versions.openssl);
// If env var is set then enable async_hook hooks for all tests.
if (process.env.NODE_TEST_WITH_ASYNC_HOOKS) {