Skip to content

Commit d034d2d

Browse files
authored
Merge pull request #27560 from brentdax/not-an-environmentalist
[tests] Add mechanism to override lit environment
2 parents a9588b3 + 3bbd176 commit d034d2d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/lit.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,5 +1666,12 @@ if platform.system() == 'Linux':
16661666
config.available_features.add("LinuxDistribution=" + distributor + '-' + release)
16671667
lit_config.note('Running tests on %s-%s' % (distributor, release))
16681668

1669+
# Copy environment variables specified in --param copy_env=..., overriding
1670+
# anything computed here. It's assumed that the person setting this knows what
1671+
# they're doing.
1672+
copy_env = lit_config.params.get('copy_env', None)
1673+
if copy_env is not None:
1674+
for key in copy_env.split(':'):
1675+
config.environment[key] = os.environ[key]
16691676

16701677
lit_config.note("Available features: " + ", ".join(sorted(config.available_features)))

0 commit comments

Comments
 (0)