Skip to content

Commit

Permalink
SCCRawStack: Use tmp_path fixture and redirect OMNI xmods
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange05 committed Jun 14, 2024
1 parent d423585 commit e8da699
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions loki/transformations/tests/test_raw_stack_allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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 = ()
Expand Down

0 comments on commit e8da699

Please sign in to comment.