Skip to content

Commit 424f254

Browse files
danbevMylesBorins
authored andcommitted
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: #25147 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 173e5fe commit 424f254

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/common/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const {
3737

3838
const noop = () => {};
3939

40+
const hasCrypto = Boolean(process.versions.openssl);
41+
4042
const isMainThread = (() => {
4143
try {
4244
return require('worker_threads').isMainThread;
@@ -74,6 +76,9 @@ if (process.argv.length === 2 &&
7476
const args = process.execArgv.map((arg) => arg.replace(/_/g, '-'));
7577
for (const flag of flags) {
7678
if (!args.includes(flag) &&
79+
// If the binary was built without-ssl then the crypto flags are
80+
// invalid (bad option). The test itself should handle this case.
81+
hasCrypto &&
7782
// If the binary is build without `intl` the inspect option is
7883
// invalid. The test itself should handle this case.
7984
(process.config.variables.v8_enable_inspector !== 0 ||
@@ -106,7 +111,6 @@ const rootDir = isWindows ? 'c:\\' : '/';
106111

107112
const buildType = process.config.target_defaults.default_configuration;
108113

109-
const hasCrypto = Boolean(process.versions.openssl);
110114

111115
// If env var is set then enable async_hook hooks for all tests.
112116
if (process.env.NODE_TEST_WITH_ASYNC_HOOKS) {

0 commit comments

Comments
 (0)