Skip to content

Commit 45ba9b4

Browse files
authored
Add final set of failing tests for OS X cling and disable docfeatures (#83)
1 parent 3e8f03e commit 45ba9b4

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

test/test_doc_features.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def setup_module(mod):
99
setup_make("doc_helper")
1010

1111

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

488489

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

737739

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

10771080
# The series of tests below mostly exists already in other places, but these
10781081
# were used as examples for the CaaS' cppyy presentation and are preserved here.
1082+
@mark.skipif((IS_MAC_ARM or IS_MAC_X86) and (not IS_CLANG_REPL), reason="setup class fails with OS X cling")
10791083
class TestTALKEXAMPLES:
10801084
def setup_class(cls):
10811085
import cppyy

test/test_pythonify.py

Lines changed: 2 additions & 1 deletion
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, ispypy
3+
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86
44

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

380380
assert example01.getCount() == 0
381381

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

test/test_pythonization.py

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

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

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

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

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

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

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

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

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

217220
assert Countable.sInstances == oldcount
218221

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

test/test_regression.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ def test13_char_star_over_char(self):
307307
assert cppyy.gbl.csoc3.call('0') == 'string'
308308
assert cppyy.gbl.csoc3.call('00') == 'string'
309309

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

@@ -739,6 +740,7 @@ def test26_const_charptr_data(self):
739740
with raises(TypeError):
740741
io.BackendPlatformName = "aap"
741742

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

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

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

test/test_stltypes.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ class PairVector {
499499
ll4[1] = 'a'
500500
raises(TypeError, a.vector_pair, ll4)
501501

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

@@ -704,6 +705,7 @@ class Point3D {
704705

705706
assert cppsum == pysum
706707

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

@@ -836,7 +838,7 @@ def test04_array_of_strings(self):
836838
for k in range(2):
837839
assert str_array_4[i][j][k] == vals[i*4+j*2+k]
838840

839-
@mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes with ClangRepl with 'toString not implemented'")
841+
@mark.xfail(run=False, reason="Crashes with ClangRepl with 'toString not implemented' and fails on OS X Cling")
840842
def test05_stlstring_and_unicode(self):
841843
"""Mixing unicode and std::string"""
842844

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

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

@@ -1216,6 +1218,7 @@ def test02_keyed_maptype(self):
12161218

12171219
assert len(a) == self.N
12181220

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

@@ -1665,6 +1668,7 @@ def setup_class(cls):
16651668
cls.stltypes = cppyy.load_reflection_info(cls.test_dct)
16661669
cls.N = cppyy.gbl.N
16671670

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

@@ -1946,7 +1950,7 @@ def test01_basics(self):
19461950
assert YourError.__cpp_name__ == 'ErrorNamespace::YourError'
19471951
assert YourError.__module__ == 'cppyy.gbl.ErrorNamespace'
19481952

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

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

1986-
@mark.xfail(condition=IS_CLANG_REPL, reason="Fails with ClangRepl")
1990+
@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")
19871991
def test03_memory(self):
19881992
"""Memory handling of C++ c// helper for exception base class testing"""
19891993

test/test_templates.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def test00_template_back_reference(self):
2323
v1 = cppyy.gbl.std.vector[int]
2424
assert v1.__cpp_template__[int] is v1
2525

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

@@ -238,6 +239,7 @@ def test09_templated_callable(self):
238239

239240
assert tc(5) == 5.
240241

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

@@ -524,6 +526,7 @@ class C {
524526

525527
assert cppyy.gbl.TemplatedCtor.C(0)
526528

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

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

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

0 commit comments

Comments
 (0)