From 521393b34e5f076dfe7a8ea14e469bb95f0b48e2 Mon Sep 17 00:00:00 2001 From: maximusron Date: Sat, 4 May 2024 16:02:26 +0200 Subject: [PATCH 1/2] [ci] Disable crashing tests on Apple Silicon --- test/test_crossinheritance.py | 1 + test/test_datatypes.py | 4 ++-- test/test_doc_features.py | 10 +++++----- test/test_overloads.py | 4 ++-- test/test_stltypes.py | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/test_crossinheritance.py b/test/test_crossinheritance.py index 8e3e4433..97c61454 100644 --- a/test/test_crossinheritance.py +++ b/test/test_crossinheritance.py @@ -273,6 +273,7 @@ def sum_value(self, val): assert 'ValueError' in res assert os.path.basename(__file__) in res + @mark.xfail(run=not IS_MAC_ARM, condition=IS_MAC_ARM, reason="Crashes with exception not being caught on Apple Silicon") def test09_interface_checking(self): """Conversion errors should be Python exceptions""" diff --git a/test/test_datatypes.py b/test/test_datatypes.py index 9d3e388d..ed798b4b 100644 --- a/test/test_datatypes.py +++ b/test/test_datatypes.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86 +from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("datatypesDict")) @@ -1410,7 +1410,7 @@ def pyd(arg0, arg1): gc.collect() raises(TypeError, c, 3, 3) # lambda gone out of scope - @mark.xfail + @mark.xfail(run=not IS_MAC_ARM, reason="Crashes with exception not being caught on Apple Silicon") def test28_callable_through_function_passing(self): """Passing callables through std::function""" diff --git a/test/test_doc_features.py b/test/test_doc_features.py index 6a9d773e..8edb8de0 100644 --- a/test/test_doc_features.py +++ b/test/test_doc_features.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86 +from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("doc_helperDict")) @@ -387,7 +387,7 @@ def test_unary_operators(sef): pass - @mark.xfail + @mark.xfail(run=not IS_MAC_ARM, reason="Crashes with exception not being caught on Apple Silicon") def test_x_inheritance(self): import cppyy from cppyy.gbl import Abstract, Concrete, call_abstract_method @@ -453,7 +453,7 @@ def abstract_method2(self): assert cppyy.gbl.call_abstract_method1(pc) == "first message" assert cppyy.gbl.call_abstract_method2(pc) == "second message" - @mark.xfail + @mark.xfail(run=not IS_MAC_ARM, reason="Crashes with exception not being caught on Apple Silicon") def test_exceptions(self): """Exception throwing and catching""" @@ -1125,7 +1125,7 @@ def add(self, i): m = PyMyClass(1) assert CC.callb(m, 2) == 5 - @mark.xfail(condition=IS_CLANG_REPL, reason="Fails with ClangRepl") + @mark.xfail(run=not IS_MAC_ARM, condition=IS_CLANG_REPL, reason="Fails with ClangRepl, Crashes on OS X arm") def test_cross_and_templates(self): """Template instantiation with cross-inheritance example""" @@ -1244,7 +1244,7 @@ def test_autocast_and_identiy(self): assert type(b) == CC.Derived assert d is b - @mark.xfail + @mark.xfail(run=not IS_MAC_ARM, reason="Seg Faults") def test_exceptions(self): """Exceptions example""" diff --git a/test/test_overloads.py b/test/test_overloads.py index 2b0936ae..58c0e6c0 100644 --- a/test/test_overloads.py +++ b/test/test_overloads.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC_X86 +from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC_X86, IS_MAC_ARM currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("overloadsDict")) @@ -206,7 +206,7 @@ def test09_bool_int_overloads(self): with raises(ValueError): cpp.BoolInt4.fff(2) - @mark.xfail + @mark.xfail(run=not IS_MAC_ARM, reason="Seg Faults") def test10_overload_and_exceptions(self): """Prioritize reporting C++ exceptions from callee""" diff --git a/test/test_stltypes.py b/test/test_stltypes.py index 08575067..bfb3b803 100644 --- a/test/test_stltypes.py +++ b/test/test_stltypes.py @@ -1,7 +1,7 @@ # -*- coding: UTF-8 -*- import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, pylong, pyunicode, maxvalue, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86 +from .support import setup_make, pylong, pyunicode, maxvalue, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("stltypesDict")) @@ -2028,7 +2028,7 @@ def run_raiseit(t1, t2): gc.collect() assert cppyy.gbl.GetMyErrorCount() == 0 - @mark.xfail + @mark.xfail(run=not IS_MAC_ARM, reason="Seg Faults") def test04_from_cpp(self): """Catch C++ exceptiosn from C++""" From 473c1cc98df4c6cac1f3f8cc0c9c01379b569301 Mon Sep 17 00:00:00 2001 From: maximusron Date: Sat, 4 May 2024 16:57:36 +0200 Subject: [PATCH 2/2] [ci] Extend fail tags for OS X x86 to arm --- test/test_advancedcpp.py | 4 ++-- test/test_api.py | 6 +++--- test/test_crossinheritance.py | 12 ++++++------ test/test_datatypes.py | 4 ++-- test/test_doc_features.py | 2 +- test/test_overloads.py | 8 ++++---- test/test_pythonization.py | 4 ++-- test/test_regression.py | 8 ++++---- test/test_stltypes.py | 20 ++++++++++---------- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/test/test_advancedcpp.py b/test/test_advancedcpp.py index 3b3b4ea9..eb489e55 100644 --- a/test/test_advancedcpp.py +++ b/test/test_advancedcpp.py @@ -16,7 +16,7 @@ def setup_class(cls): import cppyy cls.advanced = cppyy.load_reflection_info(cls.test_dct) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test01_default_arguments(self): """Test usage of default arguments""" @@ -683,7 +683,7 @@ def test19_comparator(self): assert a.__eq__(a) == False assert b.__eq__(b) == False - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test20_overload_order_with_proper_return(self): """Test return type against proper overload w/ const and covariance""" diff --git a/test/test_api.py b/test/test_api.py index e6a4a026..da5a5a0a 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import ispypy, IS_MAC_X86 +from .support import ispypy, IS_MAC_X86, IS_MAC_ARM class TestAPI: @@ -35,7 +35,7 @@ class APICheck { assert API.Overload_Check(m) assert API.Overload_CheckExact(m) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test02_interpreter_access(self): """Access to the python interpreter""" @@ -44,7 +44,7 @@ def test02_interpreter_access(self): assert API.Exec('import sys') - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test03_instance_conversion(self): """Proxy object conversions""" diff --git a/test/test_crossinheritance.py b/test/test_crossinheritance.py index 97c61454..b8ae6b37 100644 --- a/test/test_crossinheritance.py +++ b/test/test_crossinheritance.py @@ -508,7 +508,7 @@ def __init__(self): assert m.get_data() == 42 assert m.get_data_v() == 42 - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test15_object_returns(self): """Return of C++ objects from overridden functions""" @@ -576,7 +576,7 @@ def whoami(self): assert not not new_obj assert new_obj.whoami() == "PyDerived4" - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test16_cctor_access_controlled(self): """Python derived class of C++ class with access controlled cctor""" @@ -618,7 +618,7 @@ def whoami(self): obj = PyDerived() assert ns.callit(obj) == "PyDerived" - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test17_deep_hierarchy(self): """Test a deep Python hierarchy with pure virtual functions""" @@ -665,7 +665,7 @@ def whoami(self): assert obj.whoami() == "PyDerived4" assert ns.callit(obj) == "PyDerived4" - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test18_abstract_hierarchy(self): """Hierarchy with abstract classes""" @@ -998,7 +998,7 @@ def verify(a, n1, n2, n3): a = MyPyDerived(27, 55, nArgs=2) verify(a, 27, 55, 67) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test23_const_byvalue_return(self): """Const by-value return in overridden method""" @@ -1242,7 +1242,7 @@ class MyPyDerived(ns.Derived): assert obj.calc2() == 2 assert ns.callback2(obj) == 2 - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test28_cross_deep(self): """Deep inheritance hierarchy""" diff --git a/test/test_datatypes.py b/test/test_datatypes.py index ed798b4b..11929cef 100644 --- a/test/test_datatypes.py +++ b/test/test_datatypes.py @@ -1483,7 +1483,7 @@ def pyd(arg0, arg1): gc.collect() raises(TypeError, c, 3, 3) # lambda gone out of scope - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test29_std_function_life_lines(self): """Life lines to std::function data members""" @@ -2211,7 +2211,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, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, 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 8edb8de0..ebbf8839 100644 --- a/test/test_doc_features.py +++ b/test/test_doc_features.py @@ -1269,7 +1269,7 @@ class MyException : public std::exception { with raises(CC.MyException): CC.throw_error() - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test_unicode(self): """Unicode non-UTF-8 example""" diff --git a/test/test_overloads.py b/test/test_overloads.py index 58c0e6c0..4bd10aec 100644 --- a/test/test_overloads.py +++ b/test/test_overloads.py @@ -70,7 +70,7 @@ def test02_class_based_overloads_explicit_resolution(self): nb = ns_a_overload.b_overload() raises(TypeError, nb.f, c_overload()) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test03_fragile_class_based_overloads(self): """Test functions overloaded on void* and non-existing classes""" @@ -91,7 +91,7 @@ def test03_fragile_class_based_overloads(self): dd = cppyy.gbl.get_dd_ol() assert more_overloads().call(dd ) == "dd_ol" - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test04_fully_fragile_overloads(self): """Test that unknown* is preferred over unknown&""" @@ -121,7 +121,7 @@ def test05_array_overloads(self): assert c_overload().get_int(ah) == 25 assert d_overload().get_int(ah) == 25 - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test06_double_int_overloads(self): """Test overloads on int/doubles""" @@ -146,7 +146,7 @@ def test07_mean_overloads(self): a = array.array(l, numbers) assert round(cmean(len(a), a) - mean, 8) == 0 - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test08_const_non_const_overloads(self): """Check selectability of const/non-const overloads""" diff --git a/test/test_pythonization.py b/test/test_pythonization.py index 52f3e763..b23d9846 100644 --- a/test/test_pythonization.py +++ b/test/test_pythonization.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, mark -from .support import setup_make, pylong, IS_MAC_X86 +from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("pythonizablesDict")) @@ -230,7 +230,7 @@ def test08_base_class_pythonization(self): # associative container, with 'index' a key, not a counter #raises(IndexError, d.__getitem__, 1) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test09_cpp_side_pythonization(self): """Use of C++ side pythonizations""" diff --git a/test/test_regression.py b/test/test_regression.py index 65a1ef4a..8285c865 100644 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86 +from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM class TestREGRESSION: @@ -271,7 +271,7 @@ def test12_exception_while_exception(self): except AttributeError: pass - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test13_char_star_over_char(self): """Map str to const char* over char""" @@ -489,7 +489,7 @@ def test18_operator_plus_overloads(self): assert type(a+b) == cppyy.gbl.std.string assert a+b == 'ab' - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test19_std_string_hash(self): """Hashing of std::string""" @@ -524,7 +524,7 @@ class SignedCharRefGetter { assert obj.getter() == 'c' - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test21_temporaries_and_vector(self): """Extend a life line to references into a vector if needed""" diff --git a/test/test_stltypes.py b/test/test_stltypes.py index bfb3b803..52b5e0e0 100644 --- a/test/test_stltypes.py +++ b/test/test_stltypes.py @@ -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, reason="Fails on OS X x86") + @mark.xfail(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""" @@ -808,7 +808,7 @@ def test03_string_with_null_character(self): assert repr(std.string('ab\0c')) == repr(b'ab\0c') assert str(std.string('ab\0c')) == str('ab\0c') - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test04_array_of_strings(self): """Access to global arrays of strings""" @@ -873,7 +873,7 @@ def test05_stlstring_and_unicode(self): assert str(uas.get_string_cr(bval)) == 'ℕ' assert str(uas.get_string_cc(bval)) == 'ℕ' - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test06_stlstring_bytes_and_text(self): """Mixing of bytes and str""" @@ -891,7 +891,7 @@ def test06_stlstring_bytes_and_text(self): assert repr(ns.string_field) == repr(b'\xe9') assert str(ns.string_field) == str(b'\xe9') # b/c fails to decode - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test07_stlstring_in_dictionaries(self): """Mixing str and std::string as dictionary keys""" @@ -1199,7 +1199,7 @@ def test01_builtin_map_type(self): assert key == self.N-1 assert value == (self.N-1)*(self.N-1) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test02_keyed_maptype(self): """Test access to a map""" @@ -1228,7 +1228,7 @@ def test03_empty_maptype(self): for key, value in m: pass - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test04_unsignedvalue_typemap_types(self): """Test assignability of maps with unsigned value types""" @@ -1254,7 +1254,7 @@ def test04_unsignedvalue_typemap_types(self): raises(ValueError, mul.__setitem__, 'minus two', -2) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test05_STL_like_class_indexing_overloads(self): """Test overloading of operator[] in STL like class""" @@ -1265,7 +1265,7 @@ def test05_STL_like_class_indexing_overloads(self): assert a["some string" ] == 'string' assert a[3.1415] == 'double' - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test06_initialize_from_dict(self): """Test std::map initializion from Python dict""" @@ -1281,7 +1281,7 @@ def test06_initialize_from_dict(self): with raises(TypeError): m = mtype[int, str]({'1' : 1, '2' : 2}) - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test07_map_cpp17_style(self): """C++17 style initialization of std::map""" @@ -1296,7 +1296,7 @@ def test07_map_cpp17_style(self): assert m['1'] == 2 assert m['2'] == 1 - @mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86") + @mark.xfail(condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") def test08_map_derived_objects(self): """Enter derived objects through an initializer list"""