Skip to content

Commit a28cae0

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 <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent b3f45da commit a28cae0

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
@@ -36,6 +36,8 @@ const {
3636

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

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

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

108-
const hasCrypto = Boolean(process.versions.openssl);
109113

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

0 commit comments

Comments
 (0)