Skip to content

Commit

Permalink
Add final set of failing tests for OS X cling and disable docfeatures (
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronj0 authored May 8, 2024
1 parent 3e8f03e commit 45ba9b4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
4 changes: 4 additions & 0 deletions test/test_doc_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def setup_module(mod):
setup_make("doc_helper")


@mark.skipif((IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL), reason="setup class fails with OS X cling")
class TestDOCFEATURES:
def setup_class(cls):
cls.test_dct = test_dct
Expand Down Expand Up @@ -486,6 +487,7 @@ def test_exceptions(self):
assert caught == True


@mark.skipif((IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL), reason="setup class fails with OS X cling")
class TestTUTORIALFEATURES:
def setup_class(cls):
import cppyy
Expand Down Expand Up @@ -735,6 +737,7 @@ def test10_stl_algorithm(self):
assert n == 'thisisaC++stringing'


@mark.skipif((IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL), reason="setup class fails with OS X cling")
class TestADVERTISED:
def setup_class(cls):
import cppyy
Expand Down Expand Up @@ -1076,6 +1079,7 @@ def produce_imp(self):

# The series of tests below mostly exists already in other places, but these
# were used as examples for the CaaS' cppyy presentation and are preserved here.
@mark.skipif((IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL), reason="setup class fails with OS X cling")
class TestTALKEXAMPLES:
def setup_class(cls):
import cppyy
Expand Down
3 changes: 2 additions & 1 deletion test/test_pythonify.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, ispypy
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("example01Dict"))
Expand Down Expand Up @@ -379,6 +379,7 @@ def __init__(self, what):

assert example01.getCount() == 0

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test17_chaining(self):
"""Respective return values of temporaries should not go away"""

Expand Down
6 changes: 5 additions & 1 deletion test/test_pythonization.py
Original file line number Diff line number Diff line change
@@ -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
from .support import setup_make, pylong, IS_MAC_X86, IS_MAC_ARM, IS_CLANG_REPL

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("pythonizablesDict"))
Expand Down Expand Up @@ -63,6 +63,7 @@ def root_pythonizor(klass, name):

assert len(cppyy.gbl.CppyyLegacy.TObjString("aap")) == 4 # include '\0'

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test01_size_mapping(self):
"""Use composites to map GetSize() onto buffer returns"""

Expand All @@ -86,6 +87,7 @@ def set_size(self, buf):
assert len(y) == bsize
assert list(y) == list(map(lambda x: x*yval, range(bsize)))

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test02_size_mapping_of_templated_method(self):
"""Use composites to map GetSize() onto buffer returns"""

Expand Down Expand Up @@ -195,6 +197,7 @@ def test06_executors(self):
assert mine.__smartptr__().get().m_check == 0xcdcdcdcd
assert mine.say_hi() == "Hi!"

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test07_creates_flag(self):
"""Effect of creates flag on return type"""

Expand All @@ -216,6 +219,7 @@ def test07_creates_flag(self):

assert Countable.sInstances == oldcount

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test08_base_class_pythonization(self):
"""Derived class should not re-pythonize base class pythonization"""

Expand Down
3 changes: 3 additions & 0 deletions test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ def test13_char_star_over_char(self):
assert cppyy.gbl.csoc3.call('0') == 'string'
assert cppyy.gbl.csoc3.call('00') == 'string'

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test14_struct_direct_definition(self):
"""Struct defined directly in a scope miseed scope in renormalized name"""

Expand Down Expand Up @@ -739,6 +740,7 @@ def test26_const_charptr_data(self):
with raises(TypeError):
io.BackendPlatformName = "aap"

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test27_exception_by_value(self):
"""Proper memory management of exception return by value"""

Expand Down Expand Up @@ -774,6 +776,7 @@ class Countable : std::exception {
gc.collect()
assert ns.count() == 0

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test28_exception_as_shared_ptr(self):
"""shared_ptr of an exception object null-checking"""

Expand Down
12 changes: 8 additions & 4 deletions test/test_stltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ class PairVector {
ll4[1] = 'a'
raises(TypeError, a.vector_pair, ll4)

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test12_vector_lifeline(self):
"""Check lifeline setting on vectors of objects"""

Expand Down Expand Up @@ -704,6 +705,7 @@ class Point3D {

assert cppsum == pysum

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test20_vector_cstring(self):
"""Usage of a vector of const char*"""

Expand Down Expand Up @@ -836,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(condition=IS_CLANG_REPL, run=False, reason="Crashes with ClangRepl with 'toString not implemented'")
@mark.xfail(run=False, reason="Crashes with ClangRepl with 'toString not implemented' and fails on OS X Cling")
def test05_stlstring_and_unicode(self):
"""Mixing unicode and std::string"""

Expand Down Expand Up @@ -994,7 +996,7 @@ def EQ(result, init, methodname, *args):
assert s.rfind('c') < 0
assert s.rfind('c') == s.npos

@mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes with ClangRepl with 'toString not implemented'")
@mark.xfail(run=False, reason="Crashes with ClangRepl with 'toString not implemented' and fails on OS X Cling")
def test10_string_in_repr_and_str_bytes(self):
"""Special cases for __str__/__repr__"""

Expand Down Expand Up @@ -1216,6 +1218,7 @@ def test02_keyed_maptype(self):

assert len(a) == self.N

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test03_empty_maptype(self):
"""Test behavior of empty map<int,int>"""

Expand Down Expand Up @@ -1665,6 +1668,7 @@ def setup_class(cls):
cls.stltypes = cppyy.load_reflection_info(cls.test_dct)
cls.N = cppyy.gbl.N

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test01_deque_byvalue_regression(self):
"""Return by value of a deque used to crash"""

Expand Down Expand Up @@ -1946,7 +1950,7 @@ def test01_basics(self):
assert YourError.__cpp_name__ == 'ErrorNamespace::YourError'
assert YourError.__module__ == 'cppyy.gbl.ErrorNamespace'

@mark.xfail(condition=IS_CLANG_REPL, reason="Fails with ClangRepl")
@mark.xfail
def test02_raising(self):
"""Raise a C++ std::exception derived class as a Python excption"""

Expand Down Expand Up @@ -1983,7 +1987,7 @@ def raiseit(cls):
except cppyy.gbl.YourError as e:
assert e.what() == 'Oops'

@mark.xfail(condition=IS_CLANG_REPL, reason="Fails with ClangRepl")
@mark.xfail(condition=(IS_CLANG_REPL) or ((IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL)), reason="Fails with ClangRepl and OS X Cling")
def test03_memory(self):
"""Memory handling of C++ c// helper for exception base class testing"""

Expand Down
4 changes: 4 additions & 0 deletions test/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def test00_template_back_reference(self):
v1 = cppyy.gbl.std.vector[int]
assert v1.__cpp_template__[int] is v1

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test01_template_member_functions(self):
"""Template member functions lookup and calls"""

Expand Down Expand Up @@ -238,6 +239,7 @@ def test09_templated_callable(self):

assert tc(5) == 5.

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test10_templated_hidding_methods(self):
"""Test that base class methods are not considered when hidden"""

Expand Down Expand Up @@ -524,6 +526,7 @@ class C {

assert cppyy.gbl.TemplatedCtor.C(0)

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test21_type_deduction_with_conversion(self):
"""Template instantiation with [] -> std::vector conversion"""

Expand Down Expand Up @@ -578,6 +581,7 @@ def test22_type_deduction_of_proper_integer_size(self):
for val in [2**64, -2**63-1]:
raises(OverflowError, PassSomeInt, val)

@mark.xfail(condition=(not IS_CLANG_REPL) and (IS_MAC_ARM or IS_MAC_X86), reason="Fails on OS X Cling")
def test23_overloaded_setitem(self):
"""Template with overloaded non-templated and templated setitem"""

Expand Down

0 comments on commit 45ba9b4

Please sign in to comment.