diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17427584..57189546 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -299,6 +299,7 @@ jobs: # Install libraries used by the cppyy test suite sudo apt install libeigen3-dev sudo apt install libboost-all-dev + pip install psutil - name: Install deps on MacOS if: runner.os == 'macOS' @@ -706,13 +707,13 @@ jobs: echo ::endgroup:: echo ::group::Run complete test suite set -o pipefail - python -m pytest -sv | tee complete_testrun.log 2>&1 + python -m pytest -ra -sv | tee complete_testrun.log 2>&1 set +o pipefail echo ::group::Crashing Test Logs # See if we don't have a crash that went away # Comment out all xfails but the ones that have a run=False condition. find . -name "*.py" -exec sed -i '/run=False/!s/^ *@mark.xfail\(.*\)/#&/' {} \; - python -m pytest -n 1 -m "xfail" --runxfail -sv --max-worker-restart 512 | tee test_crashed.log 2>&1 || true + python -m pytest -n 1 -m "xfail" --runxfail -sv -ra --max-worker-restart 512 | tee test_crashed.log 2>&1 || true git checkout . echo ::endgroup:: echo ::group::XFAIL Test Logs @@ -720,7 +721,7 @@ jobs: # avoid conditionally crashing xfails find . -name "*.py" -exec sed -i -E 's/(^ *)@mark.xfail\(run=(.*)/\1@mark.skipif(condition=not \2/g' {} \; # See if we don't have an xfail that went away - python -m pytest --runxfail -sv | tee test_xfailed.log 2>&1 || true + python -m pytest --runxfail -sv -ra | tee test_xfailed.log 2>&1 || true git checkout . echo ::endgroup:: echo ::group::Passing Test Logs @@ -734,7 +735,7 @@ jobs: echo "Running valgrind on passing tests" CLANG_VERSION="${{ matrix.clang-runtime }}" SUPPRESSION_FILE="../etc/clang${CLANG_VERSION}-valgrind.supp" - valgrind --show-error-list=yes --error-exitcode=1 --track-origins=yes --suppressions="${SUPPRESSION_FILE}" --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v + valgrind --show-error-list=yes --error-exitcode=1 --track-origins=yes --gen-suppressions=all --suppressions="${SUPPRESSION_FILE}" --suppressions=../etc/valgrind-cppyy-cling.supp python -m pytest -m "not xfail" -v -ra fi export RETCODE=+$? echo ::endgroup:: diff --git a/etc/clang13-valgrind.supp b/etc/clang13-valgrind.supp index e69de29b..4db941dc 100644 --- a/etc/clang13-valgrind.supp +++ b/etc/clang13-valgrind.supp @@ -0,0 +1,17 @@ +{ + Cppyy Suppression + Memcheck:Free + fun:free + obj:* + fun:_ZNK3Cpp7JitCall6InvokeEPvNS0_7ArgListES1_ + fun:_ZL11WrapperCallPvmS_S_S_ + fun:_ZN5Cppyy5CallVEPvS0_mS0_ + fun:_ZL8GILCallVPvS_PN8CPyCppyy11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_112VoidExecutor7ExecuteEPvS2_PNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod11ExecuteFastEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod7ExecuteEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy11CPPFunction4CallERPNS_11CPPInstanceEPKP7_objectmS5_PNS_11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_1L13mp_vectorcallEPNS_11CPPOverloadEPKP7_objectmS4_ + fun:_PyObject_VectorcallTstate + fun:PyObject_Vectorcall +} \ No newline at end of file diff --git a/etc/clang16-valgrind.supp b/etc/clang16-valgrind.supp index 6fe065ef..06eb2784 100644 --- a/etc/clang16-valgrind.supp +++ b/etc/clang16-valgrind.supp @@ -32,6 +32,24 @@ fun:_ZN5clang7CodeGen15CodeGenFunction19EmitConstructorBodyERNS0_15FunctionArgListE } +{ + Cppyy Suppression + Memcheck:Free + fun:free + obj:* + fun:_ZNK3Cpp7JitCall6InvokeEPvNS0_7ArgListES1_ + fun:_ZL11WrapperCallPvmS_S_S_ + fun:_ZN5Cppyy5CallVEPvS0_mS0_ + fun:_ZL8GILCallVPvS_PN8CPyCppyy11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_112VoidExecutor7ExecuteEPvS2_PNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod11ExecuteFastEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod7ExecuteEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy11CPPFunction4CallERPNS_11CPPInstanceEPKP7_objectmS5_PNS_11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_1L13mp_vectorcallEPNS_11CPPOverloadEPKP7_objectmS4_ + fun:_PyObject_VectorcallTstate + fun:PyObject_Vectorcall +} + { Ubuntu strncmp suppression Memcheck:Addr8 diff --git a/etc/clang17-valgrind.supp b/etc/clang17-valgrind.supp index 99e83b2e..ced2a07c 100644 --- a/etc/clang17-valgrind.supp +++ b/etc/clang17-valgrind.supp @@ -201,6 +201,41 @@ fun:_ZN4llvm16SelectionDAGISel20SelectAllBasicBlocksERKNS_8FunctionE fun:_ZN4llvm16SelectionDAGISel20runOnMachineFunctionERNS_15MachineFunctionE.part.0 } + +{ + LLVM 17 suppressions : CodeGen + Memcheck:Cond + fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE + fun:_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE + fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE + fun:_ZN5clang7CodeGen13CodeGenModule10EmitGlobalENS_10GlobalDeclE + fun:_ZN5clang7CodeGen13CodeGenModule16EmitTopLevelDeclEPNS_4DeclE.part.0 + fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl18HandleTopLevelDeclEN5clang12DeclGroupRefE + fun:_ZN5clang15BackendConsumer18HandleTopLevelDeclENS_12DeclGroupRefE + fun:_ZN5clang22IncrementalASTConsumer18HandleTopLevelDeclENS_12DeclGroupRefE + fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv + fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE + fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE + fun:_ZN3Cpp11Interpreter7processERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN5clang5ValueEPPNS9_22PartialTranslationUnitEb.isra.0 +} + +{ + Cppyy Suppression + Memcheck:Free + fun:free + obj:* + fun:_ZNK3Cpp7JitCall6InvokeEPvNS0_7ArgListES1_ + fun:_ZL11WrapperCallPvmS_S_S_ + fun:_ZN5Cppyy5CallVEPvS0_mS0_ + fun:_ZL8GILCallVPvS_PN8CPyCppyy11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_112VoidExecutor7ExecuteEPvS2_PNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod11ExecuteFastEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod7ExecuteEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy11CPPFunction4CallERPNS_11CPPInstanceEPKP7_objectmS5_PNS_11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_1L13mp_vectorcallEPNS_11CPPOverloadEPKP7_objectmS4_ + fun:_PyObject_VectorcallTstate + fun:PyObject_Vectorcall +} { Ubuntu strncmp suppression @@ -239,21 +274,4 @@ fun:dl_open_worker_begin fun:_dl_catch_exception fun:dl_open_worker -} - -{ - LLVM 18 suppressions : CodeGen - Memcheck:Cond - fun:_ZN5clang7CodeGen13CodeGenModule38SetLLVMFunctionAttributesForDefinitionEPKNS_4DeclEPN4llvm8FunctionE - fun:_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE - fun:_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE - fun:_ZN5clang7CodeGen13CodeGenModule10EmitGlobalENS_10GlobalDeclE - fun:_ZN5clang7CodeGen13CodeGenModule16EmitTopLevelDeclEPNS_4DeclE.part.0 - fun:_ZN12_GLOBAL__N_117CodeGeneratorImpl18HandleTopLevelDeclEN5clang12DeclGroupRefE - fun:_ZN5clang15BackendConsumer18HandleTopLevelDeclENS_12DeclGroupRefE - fun:_ZN5clang22IncrementalASTConsumer18HandleTopLevelDeclENS_12DeclGroupRefE - fun:_ZN5clang17IncrementalParser23ParseOrWrapTopLevelDeclEv - fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE - fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE - fun:_ZN3Cpp11Interpreter7processERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN5clang5ValueEPPNS9_22PartialTranslationUnitEb.isra.0 } \ No newline at end of file diff --git a/etc/clang18-valgrind.supp b/etc/clang18-valgrind.supp index 900a9c6f..27a44c7d 100644 --- a/etc/clang18-valgrind.supp +++ b/etc/clang18-valgrind.supp @@ -219,6 +219,24 @@ fun:_ZN3Cpp11Interpreter7processERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN5clang5ValueEPPNS9_22PartialTranslationUnitEb.isra.0 } +{ + Cppyy Suppression + Memcheck:Free + fun:free + obj:* + fun:_ZNK3Cpp7JitCall6InvokeEPvNS0_7ArgListES1_ + fun:_ZL11WrapperCallPvmS_S_S_ + fun:_ZN5Cppyy5CallVEPvS0_mS0_ + fun:_ZL8GILCallVPvS_PN8CPyCppyy11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_112VoidExecutor7ExecuteEPvS2_PNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod11ExecuteFastEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy9CPPMethod7ExecuteEPvlPNS_11CallContextE + fun:_ZN8CPyCppyy11CPPFunction4CallERPNS_11CPPInstanceEPKP7_objectmS5_PNS_11CallContextE + fun:_ZN8CPyCppyy12_GLOBAL__N_1L13mp_vectorcallEPNS_11CPPOverloadEPKP7_objectmS4_ + fun:_PyObject_VectorcallTstate + fun:PyObject_Vectorcall +} + { Ubuntu strncmp suppression Memcheck:Addr8 diff --git a/etc/clang19-valgrind.supp b/etc/clang19-valgrind.supp index 707db007..8b60b306 100644 --- a/etc/clang19-valgrind.supp +++ b/etc/clang19-valgrind.supp @@ -151,3 +151,20 @@ fun:_ZN5clang17IncrementalParser5ParseEN4llvm9StringRefE fun:_ZN5clang11Interpreter5ParseEN4llvm9StringRefE } +{ +Cppyy Suppression +Memcheck:Free +fun:free +obj:* +fun:_ZNK3Cpp7JitCall6InvokeEPvNS0_7ArgListES1_ +fun:_ZL11WrapperCallPvmS_S_S_ +fun:_ZN5Cppyy5CallVEPvS0_mS0_ +fun:_ZL8GILCallVPvS_PN8CPyCppyy11CallContextE +fun:_ZN8CPyCppyy12_GLOBAL__N_112VoidExecutor7ExecuteEPvS2_PNS_11CallContextE +fun:_ZN8CPyCppyy9CPPMethod11ExecuteFastEPvlPNS_11CallContextE +fun:_ZN8CPyCppyy9CPPMethod7ExecuteEPvlPNS_11CallContextE +fun:_ZN8CPyCppyy11CPPFunction4CallERPNS_11CPPInstanceEPKP7_objectmS5_PNS_11CallContextE +fun:_ZN8CPyCppyy12_GLOBAL__N_1L13mp_vectorcallEPNS_11CPPOverloadEPKP7_objectmS4_ +fun:_PyObject_VectorcallTstate +fun:PyObject_Vectorcall +} \ No newline at end of file diff --git a/test/test_advancedcpp.py b/test/test_advancedcpp.py index eb489e55..da75c1d6 100644 --- a/test/test_advancedcpp.py +++ b/test/test_advancedcpp.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, pylong, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86 +from .support import setup_make, pylong, IS_WINDOWS, IS_MAC, IS_LINUX, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86 currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("advancedcppDict")) @@ -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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test01_default_arguments(self): """Test usage of default arguments""" @@ -183,7 +183,6 @@ def test03a_namespace_lookup_on_update(self): assert gbl.a_ns.d_ns.i_class.j_class.s_j == 333 assert gbl.a_ns.d_ns.i_class.j_class().m_j == -10 - @mark.xfail(run=False, reason="Crashes") def test04_template_types(self): """Test bindings of templated types""" @@ -664,7 +663,6 @@ def test18_math_converters(self): assert float(a) == 4321. assert float(a) == a.m_d - @mark.xfail def test19_comparator(self): """Check that the global operator!=/== is picked up""" @@ -683,7 +681,7 @@ def test19_comparator(self): assert a.__eq__(a) == False assert b.__eq__(b) == False - @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 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 da5a5a0a..71f492d2 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, IS_MAC_ARM +from .support import ispypy, IS_MAC class TestAPI: @@ -35,7 +35,7 @@ class APICheck { assert API.Overload_Check(m) assert API.Overload_CheckExact(m) - @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 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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, 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 9ca24482..9d90335d 100644 --- a/test/test_crossinheritance.py +++ b/test/test_crossinheritance.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC_X86, IS_CLANG_REPL, IS_CLANG_DEBUG +from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG currpath = py.path.local(__file__).dirpath() @@ -230,7 +230,7 @@ def get_value(self): p1 = TPyDerived1() assert p1.get_value() == 13 - @mark.xfail(run=not IS_MAC_ARM, condition=IS_MAC_X86 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(run=not IS_MAC_ARM, condition=IS_MAC, reason="Fails on OS X") def test08_error_handling(self): """Python errors should propagate through wrapper""" @@ -507,7 +507,7 @@ def __init__(self): assert m.get_data() == 42 assert m.get_data_v() == 42 - @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 test15_object_returns(self): """Return of C++ objects from overridden functions""" @@ -575,7 +575,7 @@ def whoami(self): assert not not new_obj assert new_obj.whoami() == "PyDerived4" - @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 test16_cctor_access_controlled(self): """Python derived class of C++ class with access controlled cctor""" @@ -617,7 +617,7 @@ def whoami(self): obj = PyDerived() assert ns.callit(obj) == "PyDerived" - @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 test17_deep_hierarchy(self): """Test a deep Python hierarchy with pure virtual functions""" @@ -664,7 +664,7 @@ def whoami(self): assert obj.whoami() == "PyDerived4" assert ns.callit(obj) == "PyDerived4" - @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 test18_abstract_hierarchy(self): """Hierarchy with abstract classes""" @@ -997,7 +997,7 @@ def verify(a, n1, n2, n3): a = MyPyDerived(27, 55, nArgs=2) verify(a, 27, 55, 67) - @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 test23_const_byvalue_return(self): """Const by-value return in overridden method""" @@ -1241,7 +1241,7 @@ class MyPyDerived(ns.Derived): assert obj.calc2() == 2 assert ns.callback2(obj) == 2 - @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 test28_cross_deep(self): """Deep inheritance hierarchy""" diff --git a/test/test_datatypes.py b/test/test_datatypes.py index 84e052c0..4a12dc4d 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, IS_MAC_ARM, IS_MAC +from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX IS_MAC = IS_MAC_X86 or IS_MAC_ARM @@ -2055,7 +2055,7 @@ def test40_more_aggregates(self): r2 = ns.make_R2() assert r2.s.x == 1 - @mark.xfail(run=False, reason="Clang-Repl") + @mark.xfail(run=False, reason="Fails") def test41_complex_numpy_arrays(self): """Usage of complex numpy arrays""" diff --git a/test/test_doc_features.py b/test/test_doc_features.py index 0b2fbd66..329cf641 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, IS_MAC_ARM +from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("doc_helperDict")) @@ -435,7 +435,7 @@ def abstract_method(self): pc = PyConcrete4() assert call_abstract_method(pc) == "Hello, Python World! (4)" - @mark.xfail(condition=((IS_MAC_X86 or IS_MAC_ARM) and IS_CLANG_REPL), reason="Fails on OSX with Clang-REPL") + @mark.xfail(condition=((IS_MAC) and IS_CLANG_REPL), reason="Fails on OSX with Clang-REPL") def test_multi_x_inheritance(self): """Multiple cross-inheritance""" @@ -575,7 +575,7 @@ 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") + @mark.xfail(run=(not IS_MAC and IS_CLANG_REPL), condition=IS_MAC and (not IS_CLANG_REPL), reason= "Crashes on OS X Cling") def test03_STL_containers(self): """Instantiate STL containers with new class""" @@ -852,7 +852,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") + @mark.xfail(run=(not IS_MAC and IS_CLANG_REPL), condition=IS_MAC 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""" @@ -994,7 +994,7 @@ def test08_voidptr_array(self): assert n.p[2] == 0x3 assert len(n.p) == 3 - @mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes with ClangRepl with 'toString not implemented'") + @mark.xfail(condition=(IS_CLANG_REPL and IS_MAC), run=False, reason="Crashes with ClangRepl with 'toString not implemented'") def test09_custom_str(self): """Example of customized str""" @@ -1167,7 +1167,6 @@ def test_fallbacks(self): assert CC.passT(2**64-1) == 2**64-1 assert 'unsigned long long' in CC.passT.__doc__ - @mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes on Clang-REPL") def test_callbacks(self): """Function callback example""" @@ -1273,7 +1272,7 @@ class MyException : public std::exception { with raises(CC.MyException): CC.throw_error() - @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 test_unicode(self): """Unicode non-UTF-8 example""" diff --git a/test/test_fragile.py b/test/test_fragile.py index 83bff671..10f3081d 100644 --- a/test/test_fragile.py +++ b/test/test_fragile.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, skip, mark -from .support import setup_make, ispypy, IS_LINUX, IS_WINDOWS, IS_MAC_ARM, IS_CLANG_REPL +from .support import setup_make, ispypy, IS_LINUX, IS_WINDOWS, IS_MAC_ARM, IS_CLANG_REPL, IS_MAC currpath = py.path.local(__file__).dirpath() @@ -476,7 +476,7 @@ def test19_gbl_contents(self): assert not 'ESysConstants' in dd assert not 'kDoRed' in dd - @mark.xfail(run=False, reason="Crashes") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test20_capture_output(self): """Capture cerr into a string""" diff --git a/test/test_lowlevel.py b/test/test_lowlevel.py index e89cef5b..cb06a7c6 100644 --- a/test/test_lowlevel.py +++ b/test/test_lowlevel.py @@ -369,7 +369,6 @@ def py2c(pyargs): with raises(TypeError): cppyy.gbl.ArrayOfCStrings.takes_array_of_cstrings(pyargs, len(pyargs)) - @mark.xfail(run=False, reason="Valgrind") def test11_array_of_const_char_ref(self): """Test passting of const char**&""" diff --git a/test/test_overloads.py b/test/test_overloads.py index 4bd10aec..ebdb293f 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, IS_MAC_ARM +from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC, IS_MAC_ARM currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("overloadsDict")) @@ -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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, 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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, 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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, 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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, 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 dbbc663d..77382e15 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, IS_MAC_ARM, IS_CLANG_REPL +from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("pythonizablesDict")) @@ -234,7 +234,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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, 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 5fbd7d74..a9473df3 100644 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -271,7 +271,7 @@ def test12_exception_while_exception(self): except AttributeError: pass - @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 test13_char_star_over_char(self): """Map str to const char* over char""" @@ -490,7 +490,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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test19_std_string_hash(self): """Hashing of std::string""" @@ -525,7 +525,7 @@ class SignedCharRefGetter { assert obj.getter() == 'c' - @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 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 0c07003b..5a4e0e9f 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, IS_MAC_ARM, IS_MAC, IS_LINUX +from .support import setup_make, pylong, pyunicode, maxvalue, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86, IS_MAC_ARM, IS_MAC currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("stltypesDict")) @@ -430,7 +430,7 @@ def test08_vector_enum(self): ve[0] = cppyy.gbl.VecTestEnumNS.EVal2 assert ve[0] == 42 - @mark.xfail(run=not (IS_MAC_ARM or IS_MAC_X86), 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, reason="Fails on OS X") def test09_vector_of_string(self): """Adverse effect of implicit conversion on vector""" @@ -582,7 +582,7 @@ def test14_vector_of_vector_of_(self): assert vv[1][0] == 3 assert vv[1][1] == 4 - @mark.xfail + @mark.xfail(condition=not IS_CLANG_REPL and IS_MAC, reason="Fails on OS X Cling") def test15_vector_slicing(self): """Advanced test of vector slicing""" @@ -609,7 +609,7 @@ def test15_vector_slicing(self): # additional test from CPython's test suite getslice_cpython_test(vector[int]) - @mark.xfail + @mark.xfail(condition=not IS_CLANG_REPL and IS_MAC, reason="Fails on OS X Cling") def test16_vector_construction(self): """Vector construction following CPython's sequence""" @@ -810,7 +810,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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, run=False, reason="Fails on OS X") def test04_array_of_strings(self): """Access to global arrays of strings""" @@ -838,7 +838,7 @@ def test04_array_of_strings(self): for k in range(2): assert str_array_4[i][j][k] == vals[i*4+j*2+k] - @mark.xfail(run=False, reason="Crashes with ClangRepl with 'toString not implemented' and fails on OS X Cling") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test05_stlstring_and_unicode(self): """Mixing unicode and std::string""" @@ -875,7 +875,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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test06_stlstring_bytes_and_text(self): """Mixing of bytes and str""" @@ -893,7 +893,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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test07_stlstring_in_dictionaries(self): """Mixing str and std::string as dictionary keys""" @@ -996,7 +996,7 @@ def EQ(result, init, methodname, *args): assert s.rfind('c') < 0 assert s.rfind('c') == s.npos - @mark.xfail(run=False, reason="Crashes with ClangRepl with 'toString not implemented' and fails on OS X Cling") + @mark.xfail(condition=IS_MAC, run = False, reason="Crashes on OS X") def test10_string_in_repr_and_str_bytes(self): """Special cases for __str__/__repr__""" @@ -1201,7 +1201,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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test02_keyed_maptype(self): """Test access to a map""" @@ -1231,7 +1231,7 @@ def test03_empty_maptype(self): for key, value in m: pass - @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 test04_unsignedvalue_typemap_types(self): """Test assignability of maps with unsigned value types""" @@ -1257,7 +1257,7 @@ def test04_unsignedvalue_typemap_types(self): raises(ValueError, mul.__setitem__, 'minus two', -2) - @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 test05_STL_like_class_indexing_overloads(self): """Test overloading of operator[] in STL like class""" @@ -1268,7 +1268,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 or IS_MAC_ARM, reason="Fails on OS X") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test06_initialize_from_dict(self): """Test std::map initializion from Python dict""" @@ -1284,7 +1284,7 @@ def test06_initialize_from_dict(self): with raises(TypeError): m = mtype[int, str]({'1' : 1, '2' : 2}) - @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 test07_map_cpp17_style(self): """C++17 style initialization of std::map""" @@ -1299,7 +1299,7 @@ def test07_map_cpp17_style(self): assert m['1'] == 2 assert m['2'] == 1 - @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 test08_map_derived_objects(self): """Enter derived objects through an initializer list""" @@ -1347,7 +1347,7 @@ def setup_class(cls): import cppyy cls.stltypes = cppyy.load_reflection_info(cls.test_dct) - @mark.xfail + @mark.xfail(condition=not IS_CLANG_REPL and IS_MAC, reason="Fails on OS X Cling") def test01_builtin_vector_iterators(self): """Test iterator comparison with operator== reflected""" @@ -1578,7 +1578,6 @@ def test03_array_of_pointer_to_pods(self): assert gbl.ArrayTest.get_pa_px(a.data(), i) == 13*i assert gbl.ArrayTest.get_pa_py(a.data(), i) == 42*i - @mark.xfail(run=False, reason="Crashes") def test04_array_from_aggregate(self): """Initialize an array from an aggregate contructor""" @@ -1715,7 +1714,7 @@ def test01_set_iteration(self): assert i in s assert i in r - @mark.xfail + @mark.xfail(condition=IS_MAC and not IS_CLANG_REPL, reason="Fails on OS X Cling") def test02_set_iterators(self): """Access to set iterators and their comparisons""" diff --git a/test/test_streams.py b/test/test_streams.py index ea3d4ee6..9a2dc5ac 100644 --- a/test/test_streams.py +++ b/test/test_streams.py @@ -1,6 +1,6 @@ import py, os, sys from pytest import raises, mark -from .support import setup_make +from .support import setup_make, IS_MAC, IS_CLANG_REPL currpath = py.path.local(__file__).dirpath() test_dct = str(currpath.join("std_streamsDict")) @@ -32,7 +32,7 @@ def test02_std_cout(self): assert not (cppyy.gbl.std.cout is None) - @mark.xfail(run=False, reason="Crashes") + @mark.xfail(condition=IS_MAC, reason="Fails on OS X") def test03_consistent_naming_if_char_traits(self): """Naming consistency if char_traits"""