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 May 11, 2023
1 parent 89e37ef commit c1e28e2
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 @@ -811,10 +811,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 c1e28e2

Please sign in to comment.