Skip to content

Commit c9ae436

Browse files
aaronj0vgvassilev
authored andcommitted
Mark xfail conditionally for osx-x86
1 parent b622aef commit c9ae436

11 files changed

+46
-10
lines changed

test/support.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ def setup_make(targetname):
3434
IS_WINDOWS = 32
3535

3636
IS_MAC_ARM = 0
37+
IS_MAC_X86 = 0
3738
if 'darwin' in sys.platform:
3839
import platform
3940
if 'arm64' in platform.machine():
4041
IS_MAC_ARM = 64
4142
os.environ["CPPYY_UNCAUGHT_QUIET"] = "1"
43+
else:
44+
IS_MAC_X86 = 1
4245

4346
try:
4447
import __pypy__

test/test_advancedcpp.py

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

55
currpath = py.path.local(__file__).dirpath()
66
test_dct = str(currpath.join("advancedcppDict"))
@@ -16,6 +16,7 @@ def setup_class(cls):
1616
import cppyy
1717
cls.advanced = cppyy.load_reflection_info(cls.test_dct)
1818

19+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
1920
def test01_default_arguments(self):
2021
"""Test usage of default arguments"""
2122

@@ -682,6 +683,7 @@ def test19_comparator(self):
682683
assert a.__eq__(a) == False
683684
assert b.__eq__(b) == False
684685

686+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
685687
def test20_overload_order_with_proper_return(self):
686688
"""Test return type against proper overload w/ const and covariance"""
687689

test/test_api.py

Lines changed: 3 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 ispypy
3+
from .support import ispypy, IS_MAC_X86
44

55

66
class TestAPI:
@@ -35,6 +35,7 @@ class APICheck {
3535
assert API.Overload_Check(m)
3636
assert API.Overload_CheckExact(m)
3737

38+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
3839
def test02_interpreter_access(self):
3940
"""Access to the python interpreter"""
4041

@@ -43,6 +44,7 @@ def test02_interpreter_access(self):
4344

4445
assert API.Exec('import sys')
4546

47+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
4648
def test03_instance_conversion(self):
4749
"""Proxy object conversions"""
4850

test/test_concurrent.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 IS_MAC_ARM
3+
from .support import IS_MAC_ARM, IS_MAC_X86
44

55

66
class TestCONCURRENT:
@@ -86,6 +86,7 @@ def test03_timeout(self):
8686
if t.is_alive(): # was timed-out
8787
cppyy.gbl.test12_timeout.stopit[0] = True
8888

89+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
8990
def test04_cpp_threading_with_exceptions(self):
9091
"""Threads and Python exceptions"""
9192

test/test_crossinheritance.py

Lines changed: 8 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, IS_MAC_ARM, IS_CLANG_REPL, IS_CLANG_DEBUG
3+
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC_X86, IS_CLANG_REPL, IS_CLANG_DEBUG
44

55

66
currpath = py.path.local(__file__).dirpath()
@@ -230,6 +230,7 @@ def get_value(self):
230230
p1 = TPyDerived1()
231231
assert p1.get_value() == 13
232232

233+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
233234
def test08_error_handling(self):
234235
"""Python errors should propagate through wrapper"""
235236

@@ -506,6 +507,7 @@ def __init__(self):
506507
assert m.get_data() == 42
507508
assert m.get_data_v() == 42
508509

510+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
509511
def test15_object_returns(self):
510512
"""Return of C++ objects from overridden functions"""
511513

@@ -573,6 +575,7 @@ def whoami(self):
573575
assert not not new_obj
574576
assert new_obj.whoami() == "PyDerived4"
575577

578+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
576579
def test16_cctor_access_controlled(self):
577580
"""Python derived class of C++ class with access controlled cctor"""
578581

@@ -614,6 +617,7 @@ def whoami(self):
614617
obj = PyDerived()
615618
assert ns.callit(obj) == "PyDerived"
616619

620+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
617621
def test17_deep_hierarchy(self):
618622
"""Test a deep Python hierarchy with pure virtual functions"""
619623

@@ -660,6 +664,7 @@ def whoami(self):
660664
assert obj.whoami() == "PyDerived4"
661665
assert ns.callit(obj) == "PyDerived4"
662666

667+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
663668
def test18_abstract_hierarchy(self):
664669
"""Hierarchy with abstract classes"""
665670

@@ -992,6 +997,7 @@ def verify(a, n1, n2, n3):
992997
a = MyPyDerived(27, 55, nArgs=2)
993998
verify(a, 27, 55, 67)
994999

1000+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
9951001
def test23_const_byvalue_return(self):
9961002
"""Const by-value return in overridden method"""
9971003

@@ -1235,6 +1241,7 @@ class MyPyDerived(ns.Derived):
12351241
assert obj.calc2() == 2
12361242
assert ns.callback2(obj) == 2
12371243

1244+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
12381245
def test28_cross_deep(self):
12391246
"""Deep inheritance hierarchy"""
12401247

test/test_datatypes.py

Lines changed: 3 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, pyunicode, IS_CLANG_REPL
3+
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_MAC_X86
44

55
currpath = py.path.local(__file__).dirpath()
66
test_dct = str(currpath.join("datatypesDict"))
@@ -1483,6 +1483,7 @@ def pyd(arg0, arg1):
14831483
gc.collect()
14841484
raises(TypeError, c, 3, 3) # lambda gone out of scope
14851485

1486+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
14861487
def test29_std_function_life_lines(self):
14871488
"""Life lines to std::function data members"""
14881489

@@ -2210,6 +2211,7 @@ def test44_buffer_memory_handling(self):
22102211
assert buf1.data1[i] == 1.*i
22112212
assert buf1.data2[i] == 2.*i
22122213

2214+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
22132215
def test45_const_ref_data(self):
22142216
"""Proper indirection for addressing const-ref data"""
22152217

test/test_doc_features.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, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG
3+
from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86
44

55
currpath = py.path.local(__file__).dirpath()
66
test_dct = str(currpath.join("doc_helperDict"))
@@ -1269,6 +1269,7 @@ class MyException : public std::exception {
12691269
with raises(CC.MyException):
12701270
CC.throw_error()
12711271

1272+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
12721273
def test_unicode(self):
12731274
"""Unicode non-UTF-8 example"""
12741275

test/test_overloads.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, skip, mark
3-
from .support import setup_make, ispypy, IS_WINDOWS
3+
from .support import setup_make, ispypy, IS_WINDOWS, IS_MAC_X86
44

55
currpath = py.path.local(__file__).dirpath()
66
test_dct = str(currpath.join("overloadsDict"))
@@ -70,6 +70,7 @@ def test02_class_based_overloads_explicit_resolution(self):
7070
nb = ns_a_overload.b_overload()
7171
raises(TypeError, nb.f, c_overload())
7272

73+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
7374
def test03_fragile_class_based_overloads(self):
7475
"""Test functions overloaded on void* and non-existing classes"""
7576

@@ -90,6 +91,7 @@ def test03_fragile_class_based_overloads(self):
9091
dd = cppyy.gbl.get_dd_ol()
9192
assert more_overloads().call(dd ) == "dd_ol"
9293

94+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
9395
def test04_fully_fragile_overloads(self):
9496
"""Test that unknown* is preferred over unknown&"""
9597

@@ -119,6 +121,7 @@ def test05_array_overloads(self):
119121
assert c_overload().get_int(ah) == 25
120122
assert d_overload().get_int(ah) == 25
121123

124+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
122125
def test06_double_int_overloads(self):
123126
"""Test overloads on int/doubles"""
124127

@@ -143,6 +146,7 @@ def test07_mean_overloads(self):
143146
a = array.array(l, numbers)
144147
assert round(cmean(len(a), a) - mean, 8) == 0
145148

149+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
146150
def test08_const_non_const_overloads(self):
147151
"""Check selectability of const/non-const overloads"""
148152

test/test_pythonization.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, mark
3-
from .support import setup_make, pylong
3+
from .support import setup_make, pylong, IS_MAC_X86
44

55
currpath = py.path.local(__file__).dirpath()
66
test_dct = str(currpath.join("pythonizablesDict"))
@@ -230,6 +230,7 @@ def test08_base_class_pythonization(self):
230230
# associative container, with 'index' a key, not a counter
231231
#raises(IndexError, d.__getitem__, 1)
232232

233+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
233234
def test09_cpp_side_pythonization(self):
234235
"""Use of C++ side pythonizations"""
235236

test/test_regression.py

Lines changed: 4 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, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG
3+
from .support import setup_make, IS_WINDOWS, ispypy, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC_X86
44

55

66
class TestREGRESSION:
@@ -271,6 +271,7 @@ def test12_exception_while_exception(self):
271271
except AttributeError:
272272
pass
273273

274+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
274275
def test13_char_star_over_char(self):
275276
"""Map str to const char* over char"""
276277

@@ -488,6 +489,7 @@ def test18_operator_plus_overloads(self):
488489
assert type(a+b) == cppyy.gbl.std.string
489490
assert a+b == 'ab'
490491

492+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
491493
def test19_std_string_hash(self):
492494
"""Hashing of std::string"""
493495

@@ -522,6 +524,7 @@ class SignedCharRefGetter {
522524

523525
assert obj.getter() == 'c'
524526

527+
@mark.xfail(condition=IS_MAC_X86, reason="Fails on OS X x86")
525528
def test21_temporaries_and_vector(self):
526529
"""Extend a life line to references into a vector if needed"""
527530

0 commit comments

Comments
 (0)