Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,4 @@ def setup_make(targetname):
#else
true
#endif\n""") == 1)
IS_CLING = not IS_CLANG_REPL
8 changes: 6 additions & 2 deletions test/test_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test01_any_class(self):

assert std.list[any]

@mark.xfail
@mark.skip
def test02_any_usage(self):
"""boost::any assignment and casting"""

Expand Down Expand Up @@ -101,7 +101,7 @@ def setup_class(cls):
cppyy.include("boost/variant/variant.hpp")
cppyy.include("boost/variant/get.hpp")

@mark.xfail
@mark.skip
def test01_variant_usage(self):
"""boost::variant usage"""

Expand Down Expand Up @@ -130,6 +130,10 @@ class C { }; } """)
assert v.back().which() == 2

assert type(boost.get['BV::A'](v[0])) == cpp.BV.A

# Trying to raise this exception seg faults, by trying to execute an unfit instantiation.
# This comes from `Instantiate` obtaining a single handle and providing a result
# The same issue happens with trying `BestOverloadFunctionMatch` first since the candidate set is single
raises(Exception, boost.get['BV::B'], v[0])
assert type(boost.get['BV::B'](v[1])) == cpp.BV.B
assert type(boost.get['BV::C'](v[2])) == cpp.BV.C
Expand Down
4 changes: 2 additions & 2 deletions test/test_conversions.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
from .support import setup_make, IS_LINUX, IS_CLANG_REPL, IS_CLING, IS_MAC

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("conversionsDict"))
Expand Down Expand Up @@ -87,7 +87,7 @@ def test03_error_handling(self):
gc.collect()
assert CC.s_count == 0

@mark.xfail
@mark.xfail(run = not(IS_LINUX and IS_CLING), condition = IS_MAC or IS_CLING, reason = "Fails on OS X + Cling, Crashes on Linux + Cling")
def test04_implicit_conversion_from_tuple(self):
"""Allow implicit conversions from tuples as arguments {}-like"""

Expand Down
12 changes: 6 additions & 6 deletions test/test_cpp11features.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, ispypy, IS_CLANG_REPL, IS_LINUX_ARM
from .support import setup_make, ispypy, IS_CLANG_REPL, IS_LINUX_ARM, IS_LINUX, IS_MAC, IS_CLING


currpath = py.path.local(__file__).dirpath()
Expand Down Expand Up @@ -44,7 +44,7 @@ def test01_smart_ptr(self):
gc.collect()
assert TestSmartPtr.s_counter == 0

@mark.xfail(run=False, reason="Crashes")
@mark.xfail(run = False, condition=IS_LINUX_ARM, reason="Valgrind issues")
def test02_smart_ptr_construction(self):
"""Shared/Unique pointer ctor is templated, requiring special care"""

Expand Down Expand Up @@ -72,7 +72,7 @@ class C(TestSmartPtr):
gc.collect()
assert TestSmartPtr.s_counter == 0

@mark.xfail(run=False, reason="Crashes")
@mark.xfail(run = False, condition = IS_LINUX, reason = "Passes, but Valgrind issue")
def test03_smart_ptr_memory_handling(self):
"""Test shared/unique pointer memory ownership"""

Expand Down Expand Up @@ -103,7 +103,7 @@ class C(TestSmartPtr):
gc.collect()
assert TestSmartPtr.s_counter == 0

@mark.xfail(run=False, reason="Crashes")
@mark.xfail
def test04_shared_ptr_passing(self):
"""Ability to pass shared_ptr<Derived> through shared_ptr<Base>"""

Expand Down Expand Up @@ -409,7 +409,7 @@ def test13_stdhash(self):
assert hash(sw) == 17
assert hash(sw) == 17

@mark.xfail(run=False, reason="Crashes")
@mark.xfail
def test14_shared_ptr_passing(self):
"""Ability to pass normal pointers through shared_ptr by value"""

Expand All @@ -435,7 +435,7 @@ def test14_shared_ptr_passing(self):
gc.collect()
assert TestSmartPtr.s_counter == 0

@mark.xfail
@mark.xfail(condition=IS_CLING, reason = "Fails on Cling")
def test15_unique_ptr_template_deduction(self):
"""Argument type deduction with std::unique_ptr"""

Expand Down
8 changes: 4 additions & 4 deletions test/test_crossinheritance.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, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM
from .support import setup_make, pylong, IS_MAC_ARM, IS_MAC, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_LINUX_ARM, IS_LINUX


currpath = py.path.local(__file__).dirpath()
Expand Down Expand Up @@ -130,7 +130,7 @@ def get_value(self):
assert c4.m_int == 88
assert CX.IBase2.call_get_value(c4) == 77

@mark.xfail(condition=IS_MAC_ARM, run=not IS_MAC_ARM, reason="Crashes with exception not being caught on Apple Silicon")
@mark.xfail(run=False, condition=IS_MAC_ARM, reason="Crashes with exception not being caught on Apple Silicon")
def test04_arguments(self):
"""Test ability to override functions that take arguments"""

Expand Down Expand Up @@ -405,7 +405,7 @@ def call(self):
gc.collect()
assert CB.s_count == 0 + start_count

@mark.xfail(run=False, reason="Crashes")
@mark.xfail(run = False, condition = IS_LINUX, reason = "Passes, but Valgrind issue")
def test12_python_shared_ptr_memory(self):
"""Usage of Python derived objects with std::shared_ptr"""

Expand Down Expand Up @@ -1034,7 +1034,7 @@ def return_const(self):
assert a.return_const().m_value == "abcdef"
assert ns.callit(a).m_value == "abcdef"

@mark.xfail
@mark.xfail(condition = IS_MAC, reason = "Fails on OS X")
def test24_non_copyable(self):
"""Inheriting from a non-copyable base class"""

Expand Down
14 changes: 7 additions & 7 deletions test/test_datatypes.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, pyunicode, IS_CLANG_REPL, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL, IS_CLING, IS_MAC_X86, IS_MAC_ARM, IS_MAC, IS_LINUX

IS_MAC = IS_MAC_X86 or IS_MAC_ARM

Expand Down Expand Up @@ -1269,7 +1269,7 @@ def run(self, f, buf, total):
if self.has_byte:
run(self, cppyy.gbl.sum_byte_data, buf, total)

@mark.xfail(run=not(((IS_CLANG_REPL and IS_MAC) or (not IS_CLANG_REPL and IS_MAC))), reason="Crashes")
@mark.xfail(run=not(IS_MAC), reason="Crashes on OS X")
def test26_function_pointers(self):
"""Function pointer passing"""

Expand Down Expand Up @@ -1332,7 +1332,7 @@ def sum_in_python(i1, i2, i3):
ns = cppyy.gbl.FuncPtrReturn
assert ns.foo()() == "Hello, World!"

@mark.xfail(run=False, condition=(IS_CLANG_REPL and IS_MAC) or (not IS_CLANG_REPL and IS_MAC), reason="Crashes")
@mark.xfail(run=False, condition=IS_MAC, reason="Crashes")
def test27_callable_passing(self):
"""Passing callables through function pointers"""

Expand Down Expand Up @@ -1643,7 +1643,7 @@ def test31_anonymous_union(self):
assert type(p.data_c[0]) == float
assert p.intensity == 5.

@mark.xfail(condition=not IS_CLANG_REPL, reason="Fails on Cling")
@mark.xfail(condition=IS_CLING, reason="Fails on Cling")
def test32_anonymous_struct(self):
"""Anonymous struct creates an unnamed type"""

Expand Down Expand Up @@ -2011,7 +2011,7 @@ class Atom {
assert b.name == "aap"
assert b.buf_type == ns.SHAPE

@mark.xfail(run=not IS_CLANG_REPL, reason="Crashes")
@mark.xfail
def test40_more_aggregates(self):
"""More aggregate testings (used to fail/report errors)"""

Expand Down Expand Up @@ -2049,7 +2049,7 @@ def test40_more_aggregates(self):
r2 = ns.make_R2()
assert r2.s.x == 1

@mark.xfail(run=False, reason="Fails")
@mark.xfail(condition=IS_MAC and IS_CLING, reason="Fails on OS X and Cling")
def test41_complex_numpy_arrays(self):
"""Usage of complex numpy arrays"""

Expand Down Expand Up @@ -2097,7 +2097,7 @@ def pycompdot(a, b, N):
Ccl = func(Acl, Bcl, 2)
assert complex(Ccl) == pyCcl

@mark.xfail
@mark.xfail(condition=(IS_MAC and IS_CLING), reason = "Fails on OS X Cling")
def test42_mixed_complex_arithmetic(self):
"""Mixin of Python and C++ std::complex in arithmetic"""

Expand Down
19 changes: 10 additions & 9 deletions test/test_doc_features.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, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM, IS_LINUX_ARM
from .support import setup_make, ispypy, IS_WINDOWS, IS_CLANG_REPL, IS_CLING, IS_CLANG_DEBUG, IS_MAC, IS_MAC_X86, IS_MAC_ARM, IS_LINUX_ARM

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("doc_helperDict"))
Expand All @@ -9,7 +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")
@mark.skipif(IS_MAC and IS_CLING, reason="setup class fails with OS X cling")
class TestDOCFEATURES:
def setup_class(cls):
cls.test_dct = test_dct
Expand Down Expand Up @@ -485,7 +485,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")
@mark.skipif(IS_MAC and IS_CLING, reason="setup class fails with OS X cling")
class TestTUTORIALFEATURES:
def setup_class(cls):
import cppyy
Expand Down Expand Up @@ -574,7 +574,7 @@ def test02_python_introspection(self):
assert not isinstance(i, int)
assert isinstance(i, Integer1)

@mark.xfail(run=(not IS_MAC and IS_CLANG_REPL), condition=IS_MAC 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 IS_CLING, reason= "Crashes on OS X Cling")
def test03_STL_containers(self):
"""Instantiate STL containers with new class"""

Expand Down Expand Up @@ -612,7 +612,7 @@ def pythonizor(klass, name):
i2 = Integer2(13)
assert int(i2) == 13

@mark.xfail(condition=IS_MAC and not IS_CLANG_REPL, reason="Fails on OSX Cling")
@mark.xfail(condition=IS_MAC and IS_CLING, reason="Fails on OSX Cling")
def test06_add_operator(self):
"""Add operator+"""

Expand Down Expand Up @@ -735,7 +735,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")
@mark.skipif(IS_MAC and IS_CLING, reason="setup class fails with OS X cling")
class TestADVERTISED:
def setup_class(cls):
import cppyy
Expand Down Expand Up @@ -850,7 +850,7 @@ def test03_use_of_ctypes_and_enum(self):
assert list(arr) == [1, 42, 1, 42]
cppyy.gbl.free(vp)

@mark.xfail(run=(not IS_MAC and IS_CLANG_REPL), condition=IS_MAC 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 IS_CLING, reason= "Crashes on OS X Cling")
def test04_ptr_ptr_python_owns(self):
"""Example of ptr-ptr use where python owns"""

Expand Down Expand Up @@ -1018,7 +1018,7 @@ def pythonize_topologic_printing(klass, name):

assert str(s) == "hi there!"

@mark.xfail
@mark.xfail(condition = IS_MAC, reason = "Fails on OS X")
def test10_llvm_blog(self):
"""Test code posted in the LLVM blog posting"""

Expand Down Expand Up @@ -1074,7 +1074,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")
@mark.skipif(IS_MAC and IS_CLING, reason="setup class fails with OS X cling")
class TestTALKEXAMPLES:
def setup_class(cls):
import cppyy
Expand All @@ -1092,6 +1092,7 @@ def setup_class(cls):

cppyy.gbl.talk_examples

# @mark.skip
def test_template_instantiation(self):
"""Run-time template instantiation example"""

Expand Down
4 changes: 2 additions & 2 deletions test/test_eigen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import mark, raises
from .support import setup_make, IS_CLANG_REPL, IS_MAC_X86
from .support import setup_make, IS_CLANG_REPL, IS_CLING, IS_MAC_X86

inc_paths = [os.path.join(os.path.sep, 'usr', 'include'),
os.path.join(os.path.sep, 'usr', 'local', 'include')]
Expand Down Expand Up @@ -158,7 +158,7 @@ def setup_class(cls):
warnings.simplefilter('ignore')
cppyy.include('Eigen/Dense')

@mark.xfail(condition=IS_MAC_X86 and (not IS_CLANG_REPL), reason="Errors out on OS X Cling")
@mark.xfail(condition=IS_MAC_X86 and IS_CLING, reason="Errors out on OS X Cling")
def test01_use_of_Map(self):
"""Use of Map (used to crash)"""

Expand Down
2 changes: 0 additions & 2 deletions test/test_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def test02_builtin_cpp_casts(self):
assert len(ll.reinterpret_cast['int*'](0)) == 0
raises(ReferenceError, ll.reinterpret_cast['int*'](0).__getitem__, 0)

@mark.xfail
def test03_memory(self):
"""Memory allocation and free-ing"""

Expand Down Expand Up @@ -681,7 +680,6 @@ def test03_3D_arrays(self):
assert arr[i][j][k] == val
assert arr[i, j, k] == val

@mark.xfail
def test04_malloc(self):
"""Use of malloc to create multi-dim arrays"""

Expand Down
6 changes: 2 additions & 4 deletions test/test_operators.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, maxvalue, IS_WINDOWS
from .support import setup_make, pylong, maxvalue, IS_WINDOWS, IS_MAC, IS_CLANG_REPL, IS_CLING

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("operatorsDict"))
Expand Down Expand Up @@ -224,7 +224,6 @@ def test08_call_to_getsetitem_mapping(self):
assert m[1] == 74
assert m(1,2) == 74

@mark.xfail
def test09_templated_operator(self):
"""Templated operator<()"""

Expand Down Expand Up @@ -296,7 +295,6 @@ def test11_overloaded_operators(self):

assert v-w == 1-3 + 2-4

@mark.xfail
def test12_unary_operators(self):
"""Unary operator-+~"""

Expand Down Expand Up @@ -339,7 +337,7 @@ def test14_single_argument_call(self):
b = ns.Bar()
assert b[42] == 42

@mark.xfail
@mark.xfail(condition = (IS_MAC and IS_CLING), reason = "Fails on OS X Cling")
def test15_class_and_global_mix(self):
"""Iterator methods have both class and global overloads"""

Expand Down
6 changes: 3 additions & 3 deletions 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, IS_CLANG_REPL, IS_MAC_ARM, IS_MAC_X86, IS_MAC
from .support import setup_make, pylong, ispypy, IS_CLANG_REPL, IS_CLING, IS_MAC_ARM, IS_MAC_X86, IS_MAC

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("example01Dict"))
Expand Down Expand Up @@ -379,7 +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")
@mark.xfail(condition = IS_MAC and IS_CLING, reason = "Fails on OS X Cling")
def test17_chaining(self):
"""Respective return values of temporaries should not go away"""

Expand Down Expand Up @@ -496,7 +496,7 @@ def verify_b(b, val, ti, to):
with raises(TypeError):
c.callme(a=1, b=2)

@mark.xfail(condition=(not IS_CLANG_REPL) or IS_MAC, reason="Fails on Cling and OSX")
@mark.xfail(condition=IS_MAC or IS_CLING, reason="Fails on Cling and OSX")
def test19_keywords_and_defaults(self):
"""Use of keyword arguments mixed with defaults"""

Expand Down
Loading