From e8da6991deaf91eb64082f94aaaf3df218216c39 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 14 Jun 2024 14:06:02 +0000 Subject: [PATCH] SCCRawStack: Use tmp_path fixture and redirect OMNI xmods --- .../transformations/tests/test_raw_stack_allocator.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/loki/transformations/tests/test_raw_stack_allocator.py b/loki/transformations/tests/test_raw_stack_allocator.py index db1df3e12..170ee7801 100644 --- a/loki/transformations/tests/test_raw_stack_allocator.py +++ b/loki/transformations/tests/test_raw_stack_allocator.py @@ -16,7 +16,6 @@ from loki.frontend import available_frontends, OMNI from loki.ir import FindNodes, CallStatement, Assignment, Pragma from loki.sourcefile import Sourcefile -from loki.tools import gettempdir from loki.types import BasicType from loki.transformations.array_indexing import normalize_range_indexing @@ -33,7 +32,7 @@ def fixture_horizontal(): @pytest.mark.parametrize('directive', ['openacc', 'openmp']) @pytest.mark.parametrize('frontend', available_frontends()) -def test_raw_stack_allocator_temporaries(frontend, block_dim, horizontal, directive): +def test_raw_stack_allocator_temporaries(frontend, block_dim, horizontal, directive, tmp_path): fcode_parkind_mod = """ module parkind1 @@ -236,7 +235,7 @@ def test_raw_stack_allocator_temporaries(frontend, block_dim, horizontal, direct end module kernel3_mod """.strip() - basedir = gettempdir()/'test_pool_allocator_temporaries' + basedir = tmp_path/'test_pool_allocator_temporaries' basedir.mkdir(exist_ok=True) (basedir/'driver.F90').write_text(fcode_driver) (basedir/'kernel1_mod.F90').write_text(fcode_kernel1) @@ -257,11 +256,11 @@ def test_raw_stack_allocator_temporaries(frontend, block_dim, horizontal, direct if frontend == OMNI: (basedir/'parkind_mod.F90').write_text(fcode_parkind_mod) - parkind_mod = Sourcefile.from_file(basedir/'parkind_mod.F90', frontend=frontend) + parkind_mod = Sourcefile.from_file(basedir/'parkind_mod.F90', frontend=frontend, xmods=[tmp_path]) (basedir/'yomphy_mod.F90').write_text(fcode_yomphy_mod) - yomphy_mod = Sourcefile.from_file(basedir/'yomphy_mod.F90', frontend=frontend) + yomphy_mod = Sourcefile.from_file(basedir/'yomphy_mod.F90', frontend=frontend, xmods=[tmp_path]) (basedir/'mf_phys_mod.F90').write_text(fcode_mf_phys_mod) - mf_phys_mod = Sourcefile.from_file(basedir/'mf_phys_mod.F90', frontend=frontend) + mf_phys_mod = Sourcefile.from_file(basedir/'mf_phys_mod.F90', frontend=frontend, xmods=[tmp_path]xs) definitions = parkind_mod.definitions + yomphy_mod.definitions + mf_phys_mod.definitions else: definitions = ()