From fa85160774b2be81e692c2e57b7d3a05e41aeda7 Mon Sep 17 00:00:00 2001 From: Karoy Lorentey Date: Thu, 14 Jul 2022 15:30:30 -0700 Subject: [PATCH] [test] lit: Delay setting up %env- substitutions until we have target_env_prefix fully configured This resolves variables not properly propagating through remote-run invocations during testing. --- test/lit.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/lit.cfg b/test/lit.cfg index bcaa103bf6370..378f50ac29eca 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1954,12 +1954,6 @@ def configure_remote_run(): remote_tmp_dir, 'bin', swift_reflection_test_name) config.available_features.add('remote_run') -# Different OS's require different prefixes for the environment variables to be -# propagated to the calling contexts. -# In order to make tests OS-agnostic, names of environment variables should be -# prefixed with `%env-`, which is then expanded to the appropriate prefix. -config.substitutions.append(('%env-', config.target_env_prefix)) - config.substitutions.append(("%target-sdk-name", config.target_sdk_name)) simulator_sdks = [ @@ -2286,6 +2280,12 @@ if platform.system() != 'Darwin' or swift_test_mode == 'optimize_none_with_impli # When changing substitutions, update docs/Testing.md. # +# Different OS's require different prefixes for the environment variables to be +# propagated to the calling contexts. +# In order to make tests OS-agnostic, names of environment variables should be +# prefixed with `%env-`, which is then expanded to the appropriate prefix. +config.substitutions.append(('%env-', config.target_env_prefix)) + config.substitutions.append(('%target-clangxx', '%s -std=c++11' % config.target_clang)) config.substitutions.append(('%target-swiftxx-frontend', '%s -enable-experimental-cxx-interop' % config.target_swift_frontend))