Skip to content

Commit

Permalink
#2711 Reinstate stubgen invalid iteration space test
Browse files Browse the repository at this point in the history
  • Loading branch information
oakleybrunt committed Oct 8, 2024
1 parent f636ce8 commit 0b2f4a3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/psyclone/tests/dynamo0p3_stubgen_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,22 @@ def test_kernel_stub_invalid_iteration_space():
''' Check that we raise an exception if we attempt to generate kernel
stub for a kernel with an unsupported iteration space. '''
ast = fpapi.parse(os.path.join(BASE_PATH,
"testkern_domain_mod.F90"),
"testkern_dofs_mod.f90"),
ignore_comments=False)
metadata = LFRicKernMetadata(ast)
kernel = LFRicKern()
kernel.load_meta(metadata)
with pytest.raises(GenerationError) as excinfo:
_ = kernel.gen_stub
assert ("supports kernels that operate on one of "
"['cell_column', 'dof'] but found 'domain' in kernel "
"'testkern_domain_code'." in str(excinfo.value))
"['cell_column'] but found 'dof' in kernel "
"'testkern_dofs_code'." in str(excinfo.value))
kernel._iterates_over = "domain"
with pytest.raises(GenerationError) as excinfo:
_ = kernel.gen_stub
assert ("supports kernels that operate on one of "
"['cell_column'] but found 'domain' in kernel "
"'testkern_dofs_code'." in str(excinfo.value))


def test_stub_generate_with_anyw2():
Expand Down

0 comments on commit 0b2f4a3

Please sign in to comment.