diff --git a/test/test_datatypes.py b/test/test_datatypes.py index 11929cef..86062d75 100644 --- a/test/test_datatypes.py +++ b/test/test_datatypes.py @@ -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")) @@ -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""" @@ -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""" @@ -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""" @@ -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""" diff --git a/test/test_doc_features.py b/test/test_doc_features.py index ebbf8839..cbb7615c 100644 --- a/test/test_doc_features.py +++ b/test/test_doc_features.py @@ -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 @@ -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""" @@ -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""" diff --git a/test/test_lowlevel.py b/test/test_lowlevel.py index c2bf174f..1c273857 100644 --- a/test/test_lowlevel.py +++ b/test/test_lowlevel.py @@ -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")) @@ -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*[]""" diff --git a/test/test_regression.py b/test/test_regression.py index 8285c865..cf8a9f6c 100644 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -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""" @@ -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""" diff --git a/test/test_stltypes.py b/test/test_stltypes.py index 52b5e0e0..764fca40 100644 --- a/test/test_stltypes.py +++ b/test/test_stltypes.py @@ -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 which can be a specialization""" @@ -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""" @@ -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""" @@ -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""" @@ -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""" @@ -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""" diff --git a/test/test_templates.py b/test/test_templates.py index 84dde830..c553f1e7 100644 --- a/test/test_templates.py +++ b/test/test_templates.py @@ -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")) @@ -615,7 +615,7 @@ def callback(x): assert cppyy.gbl.std.function['double(std::vector)'] - @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""" @@ -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""" @@ -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""" @@ -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 @@ -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