Skip to content

Commit

Permalink
Tag OS X arm cling tests (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronj0 authored May 7, 2024
1 parent d0f72e7 commit 3e8f03e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
10 changes: 6 additions & 4 deletions test/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from pytest import raises, skip, mark
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM

IS_MAC = IS_MAC_X86 or IS_MAC_ARM

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))

Expand Down Expand Up @@ -1274,7 +1276,7 @@ def run(self, f, buf, total):
if self.has_byte:
run(self, cppyy.gbl.sum_byte_data, buf, total)

@mark.xfail(run=not IS_CLANG_REPL, reason="Crashes")
@mark.xfail(run=not(((IS_CLANG_REPL and IS_MAC) or (not IS_CLANG_REPL and IS_MAC))), reason="Crashes")
def test26_function_pointers(self):
"""Function pointer passing"""

Expand Down Expand Up @@ -1337,7 +1339,7 @@ def sum_in_python(i1, i2, i3):
ns = cppyy.gbl.FuncPtrReturn
assert ns.foo()() == "Hello, World!"

@mark.xfail(run=not IS_CLANG_REPL, reason="Crashes")
@mark.xfail(run=not(((IS_CLANG_REPL and IS_MAC) or (not IS_CLANG_REPL and IS_MAC))), reason="Crashes")
def test27_callable_passing(self):
"""Passing callables through function pointers"""

Expand Down Expand Up @@ -1483,7 +1485,7 @@ def pyd(arg0, arg1):
gc.collect()
raises(TypeError, c, 3, 3) # lambda gone out of scope

@mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X")
@mark.xfail(condition=IS_MAC, reason="Fails on OS X")
def test29_std_function_life_lines(self):
"""Life lines to std::function data members"""

Expand Down Expand Up @@ -2211,7 +2213,7 @@ def test44_buffer_memory_handling(self):
assert buf1.data1[i] == 1.*i
assert buf1.data2[i] == 2.*i

@mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X")
@mark.xfail(condition=IS_MAC, reason="Fails on OS X")
def test45_const_ref_data(self):
"""Proper indirection for addressing const-ref data"""

Expand Down
6 changes: 4 additions & 2 deletions test/test_doc_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,9 @@ def test02_python_introspection(self):
assert not isinstance(i, int)
assert isinstance(i, Integer1)

@mark.xfail(run=False, condition=(IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL), reason= "Crashes on OS X Cling")
def test03_STL_containers(self):
"""Instantiate STL contaienrs with new class"""
"""Instantiate STL containers with new class"""

from cppyy.gbl import Integer1
from cppyy.gbl.std import vector
Expand Down Expand Up @@ -849,6 +850,7 @@ def test03_use_of_ctypes_and_enum(self):
assert list(arr) == [1, 42, 1, 42]
cppyy.gbl.free(vp)

@mark.xfail(run=False, condition=(IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL), reason= "Crashes on OS X Cling")
def test04_ptr_ptr_python_owns(self):
"""Example of ptr-ptr use where python owns"""

Expand Down Expand Up @@ -1091,7 +1093,7 @@ def setup_class(cls):

cppyy.gbl.talk_examples

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test_template_instantiation(self):
"""Run-time template instantiation example"""

Expand Down
4 changes: 2 additions & 2 deletions test/test_lowlevel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import raises, skip, mark
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))
Expand Down Expand Up @@ -338,7 +338,7 @@ def test09_numpy_bool_array(self):
x = np.array([True], dtype=bool)
assert cppyy.gbl.convert_bool(x)

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test10_array_of_const_char_star(self):
"""Test passting of const char*[]"""

Expand Down
4 changes: 2 additions & 2 deletions test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test07_class_refcounting(self):

assert sys.getrefcount(x) == old_refcnt

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test08_typedef_identity(self):
"""Nested typedefs should retain identity"""

Expand Down Expand Up @@ -1088,7 +1088,7 @@ def test37_array_of_pointers_argument(self):

assert cppyy.addressof(res) == cppyy.addressof(arr)

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test38_char16_arrays(self):
"""Access to fixed-size char16 arrays as data members"""

Expand Down
12 changes: 6 additions & 6 deletions test/test_stltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def test06_vector_indexing(self):
assert v2[-1] == v[-2]
assert v2[self.N-4] == v[-2]

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test07_vector_bool(self):
"""Usability of std::vector<bool> which can be a specialization"""

Expand All @@ -408,7 +408,7 @@ def test07_vector_bool(self):
assert len(vb[4:8]) == 4
assert list(vb[4:8]) == [False]*3+[True]

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test08_vector_enum(self):
"""Usability of std::vector<> of some enums"""

Expand All @@ -430,7 +430,7 @@ def test08_vector_enum(self):
ve[0] = cppyy.gbl.VecTestEnumNS.EVal2
assert ve[0] == 42

@mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X")
@mark.xfail(run=not (IS_MAC_ARM or IS_MAC_X86), condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X")
def test09_vector_of_string(self):
"""Adverse effect of implicit conversion on vector<string>"""

Expand Down Expand Up @@ -565,7 +565,7 @@ def test13_vector_smartptr_iteration(self):
i += 1
assert i == len(result)

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test14_vector_of_vector_of_(self):
"""Nested vectors"""

Expand Down Expand Up @@ -625,7 +625,7 @@ def test17_vector_cpp17_style(self):
v = cppyy.gbl.std.vector(l)
assert list(l) == l

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test18_array_interface(self):
"""Test usage of __array__ from numpy"""

Expand Down Expand Up @@ -672,7 +672,7 @@ def test18_array_interface(self):
v = np.array(v, dtype=np.intc)
assert ns.func(v) == sum(v)

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test19_vector_point3d(self):
"""Iteration over a vector of by-value objects"""

Expand Down
10 changes: 6 additions & 4 deletions test/test_templates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os
from pytest import raises, mark
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLANG_DEBUG
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("templatesDict"))
Expand Down Expand Up @@ -615,7 +615,7 @@ def callback(x):

assert cppyy.gbl.std.function['double(std::vector<double>)']

@mark.xfail
@mark.xfail(run=(IS_MAC_ARM or IS_MAC_X86) and IS_CLANG_REPL)
def test25_stdfunction_ref_and_ptr_args(self):
"""Use of std::function with reference or pointer args"""

Expand Down Expand Up @@ -1123,7 +1123,7 @@ class TNaVU;
run_n = getattr(cppyy.gbl, 'TNaRun_%d' % n)
getattr(run_n, t)

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test33_using_template_argument(self):
"""`using` type as template argument"""

Expand Down Expand Up @@ -1153,7 +1153,7 @@ def test33_using_template_argument(self):
assert ns.testptr
assert cppyy.gbl.std.vector[ns.testptr]

@mark.xfail
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
def test34_cstring_template_argument(self):
"""`const char*` use over std::string"""

Expand All @@ -1178,6 +1178,7 @@ def test34_cstring_template_argument(self):
assert ns.stringify(ctypes.c_char_p(bytes("Noot", "ascii"))) == "Noot "


@mark.skipif(((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL), reason="setup class fails with OS X cling")
class TestTEMPLATED_TYPEDEFS:
def setup_class(cls):
cls.test_dct = test_dct
Expand Down Expand Up @@ -1295,6 +1296,7 @@ class A {
assert cppyy.gbl.FailedTypeDeducer.B[int]().result() == 5


@mark.skipif(((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL), reason="setup class fails with OS X cling")
class TestTEMPLATE_TYPE_REDUCTION:
def setup_class(cls):
cls.test_dct = test_dct
Expand Down

0 comments on commit 3e8f03e

Please sign in to comment.