8000 TST: Use ``meson`` for testing ``f2py`` by HaoZeke · Pull Request #25111 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TST: Use meson for testing f2py #25111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8d04cbf
MAINT,TST: Use meson for compiler checks [f2py]
HaoZeke Nov 11, 2023
5a2fa25
MAINT: Cache the compiler checks [f2py]
HaoZeke Nov 11, 2023
1fdc2f8
MAINT,TST: Always use meson [f2py]
HaoZeke Nov 11, 2023
babda1d
TST: Rework to have a build_meson [f2py]
HaoZeke Nov 11, 2023
278890e
MAINT,TST: Simplify the meson backend [f2py]
HaoZeke Nov 11, 2023
2f1b5c8
TST: Use the build_meson function [f2py]
HaoZeke Nov 11, 2023
9f75919
MAINT,TST: Minor cleanup [f2py]
HaoZeke Nov 11, 2023
73edb6f
TST: Ensure TestDocAdvanced runs with spin [f2py]
HaoZeke Nov 11, 2023
51a760a
TST: Use cleanup meson backend [f2py]
HaoZeke Nov 12, 2023
4da19cf
MAINT,TST: Generalize build_meson [f2py]
HaoZeke Nov 12, 2023 8000
6122eb7
TST: Use a helper for spin tests [f2py]
HaoZeke Nov 12, 2023
d678b61
MAINT: Simplify meson backend [f2py]
HaoZeke Nov 12, 2023
0397ee4
TST: Handle unsupported compilers [f2py]
HaoZeke Nov 12, 2023
74934a5
TST: Fix gibberish in [f2py] documentation test
HaoZeke Nov 12, 2023
4154877
CI: Add meson for cygwin runs
HaoZeke Nov 12, 2023
fe5bf64
TST: Skips for 32-bit errors [f2py]
HaoZeke Nov 12, 2023
6cdecd0
TST: Skip for cygwin since meson is old [f2py]
HaoZeke Nov 12, 2023
dd6f221
CI: Revert grabbing meson on cygwin
HaoZeke Nov 12, 2023
ef17ab5
TST: Cleanup old distutils builder [f2py]
HaoZeke Nov 12, 2023
8d7ec08
TST: Skip cygwin better [f2py]
HaoZeke Nov 12, 2023
b0f418e
TST: Don't touch distutils
HaoZeke Nov 19, 2023
5bce3b4
MAINT: Vendor in distutils testing requirement
HaoZeke Nov 19, 2023
9fc2006
TST: Try removing cygwin restrictions
HaoZeke Nov 21, 2023
2ac2902
MAINT: Cleanup some tests [f2py]
HaoZeke Nov 23, 2023
63cbffb
TST: Try to use concurrency for i/o bounds [f2py]
HaoZeke Nov 23, 2023
64f4fd2
TST: Mark slow tests [f2py]
HaoZeke Nov 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
TST: Mark slow tests [f2py]
Should finish in around a minute now
  • Loading branch information
HaoZeke committed Nov 23, 2023
commit 64f4fd2fdd9d5d3b15f2a2a90810fa9c8220fb40
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_abstract_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


@pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess")
@pytest.mark.slow
class TestAbstractInterface(util.F2PyTest):
sources = [util.getpath("tests", "src", "abstract_interface", "foo.f90")]

Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_block_docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from numpy.testing import IS_PYPY


@pytest.mark.slow
class TestBlockDocString(util.F2PyTest):
sources = [util.getpath("tests", "src", "block_docstring", "foo.f")]

Expand Down
5 changes: 4 additions & 1 deletion numpy/f2py/tests/test_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class TestF77Callback(util.F2PyTest):
sources = [util.getpath("tests", "src", "callback", "foo.f")]

@pytest.mark.parametrize("name", "t,t2".split(","))
@pytest.mark.slow
def test_all(self, name):
self.check_function(name)

Expand Down Expand Up @@ -205,6 +206,7 @@ class TestF77CallbackPythonTLS(TestF77Callback):
class TestF90Callback(util.F2PyTest):
sources = [util.getpath("tests", "src", "callback", "gh17797.f90")]

@pytest.mark.slow
def test_gh17797(self):
def incr(x):
return x + 123
Expand All @@ -222,6 +224,7 @@ class TestGH18335(util.F2PyTest):
"""
sources = [util.getpath("tests", "src", "callback", "gh18335.f90")]

@pytest.mark.slow
def test_gh18335(self):
def foo(x):
x[0] += 1
Expand All @@ -235,7 +238,7 @@ class TestGH25211(util.F2PyTest):
util.getpath("tests", "src", "callback", "gh25211.pyf")]
module_name = "callback2"

def test_gh18335(self):
def test_gh25211(self):
def bar(x):
return x*x

Expand Down
3 changes: 3 additions & 0 deletions numpy/f2py/tests/test_character.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from numpy.f2py.tests import util


@pytest.mark.slow
class TestCharacterString(util.F2PyTest):
# options = ['--debug-capi', '--build-dir', '/tmp/test-build-f2py']
suffix = '.f90'
Expand Down Expand Up @@ -512,6 +513,7 @@ class TestMiscCharacter(util.F2PyTest):
end subroutine {fprefix}_character_bc_old
""")

@pytest.mark.slow
def test_gh18684(self):
# Test character(len=5) and character*5 usages
f = getattr(self.module, self.fprefix + '_gh18684')
Expand Down Expand Up @@ -596,6 +598,7 @@ class TestStringAssumedLength(util.F2PyTest):
def test_gh24008(self):
self.module.greet("joe", "bob")

@pytest.mark.slow
class TestStringOptionalInOut(util.F2PyTest):
sources = [util.getpath("tests", "src", "string", "gh24662.f90")]

Expand Down
3 changes: 3 additions & 0 deletions numpy/f2py/tests/test_crackfortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class TestDimSpec(util.F2PyTest):
)

@pytest.mark.parametrize("dimspec", all_dimspecs)
@pytest.mark.slow
def test_array_size(self, dimspec):

count = self.all_dimspecs.index(dimspec)
Expand Down Expand Up @@ -276,6 +277,7 @@ def test_input_encoding(self, tmp_path, encoding):
assert mod[0]['name'] == 'foo'


@pytest.mark.slow
class TestUnicodeComment(util.F2PyTest):
sources = [util.getpath("tests", "src", "crackfortran", "unicode_comment.f90")]

Expand Down Expand Up @@ -327,6 +329,7 @@ def test_nameargspattern_backtracking(self, adversary):
class TestFunctionReturn(util.F2PyTest):
sources = [util.getpath("tests", "src", "crackfortran", "gh23598.f90")]

@pytest.mark.slow
def test_function_rettype(self):
# gh-23598
assert self.module.intproduct(3, 4) == 12
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TestData(util.F2PyTest):
sources = [util.getpath("tests", "src", "crackfortran", "data_stmts.f90")]

# For gh-23276
@pytest.mark.slow
def test_data_stmts(self):
assert self.module.cmplxdat.i == 2
assert self.module.cmplxdat.j == 3
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def get_docdir():
def _path(*args):
return get_docdir().joinpath(*args)

@pytest.mark.slow
class TestDocAdvanced(util.F2PyTest):
# options = ['--debug-capi', '--build-dir', '/tmp/build-f2py']
sources = [_path('asterisk1.f90'), _path('asterisk2.f90'),
Expand Down
2 changes: 1 addition & 1 deletion numpy/f2py/tests/test_f2cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestF2Cmap(util.F2PyTest):
]

# gh-15095
def test_long_long_map(self):
def test_gh15095(self):
inp = np.ones(3)
out = self.module.func1(inp)
exp_out = 3
Expand Down
2 changes: 2 additions & 0 deletions numpy/f2py/tests/test_isoc.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
from . import util
import numpy as np
import pytest

class TestISOC(util.F2PyTest):
sources = [
util.getpath("tests", "src", "isocintrin", "isoCtests.f90"),
]

# gh-24553
@pytest.mark.slow
def test_c_double(self):
out = self.module.coddity.c_add(1, 2)
exp_out = 3
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class TestMixed(util.F2PyTest):
util.getpath("tests", "src", "mixed", "foo_free.f90"),
]

@pytest.mark.slow
def test_all(self):
assert self.module.bar11() == 11
assert self.module.foo_fixed.bar12() == 12
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_module_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from numpy.testing import IS_PYPY


@pytest.mark.slow
class TestModuleDocString(util.F2PyTest):
sources = [
util.getpath("tests", "src", "module_data",
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_quoted_character.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ class TestQuotedCharacter(util.F2PyTest):

@pytest.mark.skipif(sys.platform == "win32",
reason="Fails with MinGW64 Gfortran (Issue #9673)")
@pytest.mark.slow
def test_quoted_character(self):
assert self.module.foo() == (b"'", b'"', b";", b"!", b"(", b")")
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_return_character.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
IS_S390X = platform.machine() == "s390x"


@pytest.mark.slow
class TestReturnCharacter(util.F2PyTest):
def check_function(self, t, tname):
if tname in ["t0", "t1", "s0", "s1"]:
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_return_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from . import util


@pytest.mark.slow
class TestReturnComplex(util.F2PyTest):
def check_function(self, t, tname):
if tname in ["t0", "t8", "s0", "s8"]:
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_return_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from . import util


@pytest.mark.slow
class TestReturnInteger(util.F2PyTest):
def check_function(self, t, tname):
assert t(123) == 123
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_return_real.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from . import util


@pytest.mark.slow
class TestReturnReal(util.F2PyTest):
def check_function(self, t, tname):
if tname in ["t0", "t4", "s0", "s4"]:
Expand Down
1 change: 1 addition & 0 deletions numpy/f2py/tests/test_semicolon_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def test_multiline(self):
np.dtype(np.intp).itemsize < 8,
reason="32-bit builds are buggy"
)
@pytest.mark.slow
class TestCallstatement(util.F2PyTest):
suffix = ".pyf"
module_name = "callstatement"
Expand Down
3 changes: 2 additions & 1 deletion numpy/f2py/tests/test_value_attrspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class TestValueAttr(util.F2PyTest):
sources = [util.getpath("tests", "src", "value_attrspec", "gh21665.f90")]

# gh-21665
def test_long_long_map(self):
@pytest.mark.slow
def test_gh21665(self):
inp = 2
out = self.module.fortfuncs.square(inp)
exp_out = 4
Expand Down
0