8000 TST: Add regression test for gh-26920 · numpy/numpy@d4306dd · GitHub
[go: up one dir, main page]

Skip to content

Commit d4306dd

Browse files
m-weigandcharris
authored andcommitted
TST: Add regression test for gh-26920
1 parent c6ff254 commit d4306dd

File tree

3 files changed

+73
-0
lines changed

3 files changed

+73
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module mod2
2+
implicit none
3+
private mod2_func1
4+
contains
5+
6+
subroutine mod2_func1()
7+
print*, "mod2_func1"
8+
end subroutine mod2_func1
9+
10+
end module mod2
11+
12+
module mod1
13+
implicit none
14+
private :: mod1_func1
15+
contains
16+
17+
subroutine mod1_func1()
18+
print*, "mod1_func1"
19+
end subroutine mod1_func1
20+
21+
end module mod1
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module mod2
2+
implicit none
3+
PUBLIC :: mod2_func1
4+
contains
5+
6+
subroutine mod2_func1()
7+
print*, "mod2_func1"
8+
end subroutine mod2_func1
9+
10+
end module mod2
11+
12+
module mod1
13+
implicit none
14+
PUBLIC :: mod1_func1
15+
contains
16+
17+
subroutine mod1_func1()
18+
print*, "mod1_func1"
19+
end subroutine mod1_func1
20+
21+
end module mod1

numpy/f2py/tests/test_modules.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,37 @@
55
from numpy.testing import IS_PYPY
66

77

8+
@pytest.mark.slow
9+
class TestModuleFilterPublicEntities(util.F2PyTest):
10+
sources = [
11+
util.getpath(
12+
"tests", "src", "modules", "gh26920",
13+
"two_mods_with_one_public_routine.f90"
14+
)
15+
]
16+
# we filter the only public function mod2
17+
only = ["mod1_func1", ]
18+
19+
def test_gh26920(self):
20+
# if it compiles and can be loaded, things are fine
21+
pass
22+
23+
24+
@pytest.mark.slow
25+
class TestModuleWithoutPublicEntities(util.F2PyTest):
26+
sources = [
27+
util.getpath(
28+
"tests", "src", "modules", "gh26920",
29+
"two_mods_with_no_public_entities.f90"
30+
)
31+
]
32+
only = ["mod1_func1", ]
33+
34+
def test_gh26920(self):
35+
# if it compiles and can be loaded, things are fine
36+
pass
37+
38+
839
@pytest.mark.slow
940
class TestModuleDocString(util.F2PyTest):
1041
sources = [util.getpath("tests", "src", "modules", "module_data_docstring.f90")]

0 commit comments

Comments
 (0)
0