Skip to content

Commit 3e8f03e

Browse files
authored
Tag OS X arm cling tests (#81)
1 parent d0f72e7 commit 3e8f03e

File tree

6 files changed

+26
-20
lines changed

6 files changed

+26
-20
lines changed

test/test_datatypes.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from pytest import raises, skip, mark
33
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM
44

5+
IS_MAC = IS_MAC_X86 or IS_MAC_ARM
6+
57
currpath = py.path.local(__file__).dirpath()
68
test_dct = str(currpath.join("datatypesDict"))
79

@@ -1274,7 +1276,7 @@ def run(self, f, buf, total):
12741276
if self.has_byte:
12751277
run(self, cppyy.gbl.sum_byte_data, buf, total)
12761278

1277-
@mark.xfail(run=not IS_CLANG_REPL, reason="Crashes")
1279+
@mark.xfail(run=not(((IS_CLANG_REPL and IS_MAC) or (not IS_CLANG_REPL and IS_MAC))), reason="Crashes")
12781280
def test26_function_pointers(self):
12791281
"""Function pointer passing"""
12801282

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

1340-
@mark.xfail(run=not IS_CLANG_REPL, reason="Crashes")
1342+
@mark.xfail(run=not(((IS_CLANG_REPL and IS_MAC) or (not IS_CLANG_REPL and IS_MAC))), reason="Crashes")
13411343
def test27_callable_passing(self):
13421344
"""Passing callables through function pointers"""
13431345

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

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

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

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

test/test_doc_features.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,9 @@ def test02_python_introspection(self):
574574
assert not isinstance(i, int)
575575
assert isinstance(i, Integer1)
576576

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

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

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

@@ -1091,7 +1093,7 @@ def setup_class(cls):
10911093

10921094
cppyy.gbl.talk_examples
10931095

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

test/test_lowlevel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import py, os, sys
22
from pytest import raises, skip, mark
3-
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL
3+
from .support import setup_make, pylong, pyunicode, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86
44

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

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

test/test_regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test07_class_refcounting(self):
185185

186186
assert sys.getrefcount(x) == old_refcnt
187187

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

@@ -1088,7 +1088,7 @@ def test37_array_of_pointers_argument(self):
10881088

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

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

test/test_stltypes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def test06_vector_indexing(self):
389389
assert v2[-1] == v[-2]
390390
assert v2[self.N-4] == v[-2]
391391

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

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

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

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

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

@@ -565,7 +565,7 @@ def test13_vector_smartptr_iteration(self):
565565
i += 1
566566
assert i == len(result)
567567

568-
@mark.xfail
568+
@mark.xfail(run=not((IS_MAC_ARM or IS_MAC_X86) and not IS_CLANG_REPL))
569569
def test14_vector_of_vector_of_(self):
570570
"""Nested vectors"""
571571

@@ -625,7 +625,7 @@ def test17_vector_cpp17_style(self):
625625
v = cppyy.gbl.std.vector(l)
626626
assert list(l) == l
627627

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

@@ -672,7 +672,7 @@ def test18_array_interface(self):
672672
v = np.array(v, dtype=np.intc)
673673
assert ns.func(v) == sum(v)
674674

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

test/test_templates.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import py, os
22
from pytest import raises, mark
3-
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLANG_DEBUG
3+
from .support import setup_make, pylong, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM
44

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

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

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

@@ -1123,7 +1123,7 @@ class TNaVU;
11231123
run_n = getattr(cppyy.gbl, 'TNaRun_%d' % n)
11241124
getattr(run_n, t)
11251125

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

@@ -1153,7 +1153,7 @@ def test33_using_template_argument(self):
11531153
assert ns.testptr
11541154
assert cppyy.gbl.std.vector[ns.testptr]
11551155

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

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

11801180

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

12971298

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

0 commit comments

Comments
 (0)