Skip to content

Commit

Permalink
Restore tmp dir after init_config call in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Jul 26, 2022
1 parent a0a2730 commit 18346fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/framework/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,18 @@ def test_compiler_dependent_optarch(self):
optarch_var['Intel'] = intel_flags
optarch_var['GCC'] = gcc_flags
optarch_var['GCCcore'] = gcccore_flags

# Save current tmp dir
old_vars = {name: os.environ.get(name) for name in ('TMPDIR', 'TEMP', 'TMP')}

init_config(build_options={'optarch': optarch_var, 'silent': True})
tc = self.get_toolchain(toolchain_name, version=toolchain_ver)
tc.set_options({'optarch': enable})
tc.prepare()

# Restore tmp dir
os.environ.update(old_vars)

flags = None
if toolchain_name == 'iccifort':
flags = intel_flags_exp
Expand Down

0 comments on commit 18346fd

Please sign in to comment.