Skip to content

Commit

Permalink
Fixed failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Nov 21, 2024
1 parent f8b6e27 commit 032ab26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions tests/unit_tests/tools/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,27 @@ def test_compiler():
def test_compiler_openmp():
'''Test that the openmp flag is correctly reflected in the test if
a compiler supports OpenMP or not.'''
cc = CCompiler("gcc", "gcc", "gnu", openmp_flag="-fopenmp")
cc = CCompiler("gcc", "gcc", "gnu", openmp_flag="-fopenmp",
version_regex=None)
assert cc.openmp_flag == "-fopenmp"
assert cc.openmp
cc = CCompiler("gcc", "gcc", "gnu", openmp_flag=None)
cc = CCompiler("gcc", "gcc", "gnu", openmp_flag=None, version_regex=None)
assert cc.openmp_flag == ""
assert not cc.openmp
cc = CCompiler("gcc", "gcc", "gnu")
cc = CCompiler("gcc", "gcc", "gnu", version_regex=None)
assert cc.openmp_flag == ""
assert not cc.openmp

fc = FortranCompiler("gfortran", "gfortran", "gnu", openmp_flag="-fopenmp",
module_folder_flag="-J")
module_folder_flag="-J", version_regex=None)
assert fc.openmp_flag == "-fopenmp"
assert fc.openmp
fc = FortranCompiler("gfortran", "gfortran", "gnu", openmp_flag=None,
module_folder_flag="-J")
module_folder_flag="-J", version_regex=None)
assert fc.openmp_flag == ""
assert not fc.openmp
fc = FortranCompiler("gfortran", "gfortran", "gnu",
module_folder_flag="-J")
module_folder_flag="-J", version_regex=None)
assert fc.openmp_flag == ""
assert not fc.openmp

Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/tools/test_tool_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_tool_repository_get_default_error_missing_openmp_compiler():
ToolRepository.'''
tr = ToolRepository()
fc = FortranCompiler("gfortran", "gfortran", "gnu", openmp_flag=None,
module_folder_flag="-J")
module_folder_flag="-J", version_regex=None)

with mock.patch.dict(tr, {Category.FORTRAN_COMPILER: [fc]}), \
pytest.raises(RuntimeError) as err:
Expand Down

0 comments on commit 032ab26

Please sign in to comment.