Skip to content

Commit

Permalink
Condition xfail tags based on clang/cling profile
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronj0 committed Apr 25, 2024
1 parent 969e34a commit 8e5ccb4
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 42 deletions.
4 changes: 1 addition & 3 deletions test/test_boost.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ def setup_class(cls):
import cppyy

cppyy.include('boost/any.hpp')

@mark.skipif(not IS_CLANG_REPL, reason="Works on Clang-Repl but has not been tested on Cling")

def test01_any_class(self):
"""Availability of boost::any"""

Expand Down Expand Up @@ -144,7 +143,6 @@ def setup_class(cls):
cppyy.include("boost/type_erasure/member.hpp")
cppyy.include("boost/mpl/vector.hpp")

@mark.xfail
def test01_erasure_usage(self):
"""boost::type_erasure usage"""

Expand Down
10 changes: 2 additions & 8 deletions test/test_crossinheritance.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ def sum_all(self, *args):
assert d.sum_all(-7, -5) == 1
assert Base1.call_sum_all(d, -7, -5) == 1

@mark.skipif(not IS_CLANG_REPL, reason="Crashes on cling when \
test06_const_methods, test07_templated_base and \
test01_instance_data_read_access are run in order")
def test06_const_methods(self):
"""Declared const methods should keep that qualifier"""

Expand All @@ -208,10 +205,7 @@ def __init__(self):

assert CX.IBase4.call_get_value(c1) == 17
assert CX.IBase4.call_get_value(c2) == 27

@mark.skipif(not IS_CLANG_REPL, reason="Crashes on cling when \
test06_const_methods, test07_templated_base and \
test01_instance_data_read_access are run in order")

def test07_templated_base(self):
"""Derive from a base class that is instantiated from a template"""

Expand Down Expand Up @@ -295,7 +289,7 @@ def get_value(self):

assert raises(TypeError, Base1.call_get_value, d)

@mark.xfail
@mark.xfail(condition=IS_CLANG_REPL, reason="Fails on Clang-REPL")
def test10_python_in_templates(self):
"""Usage of Python derived objects in std::vector"""

Expand Down
3 changes: 1 addition & 2 deletions test/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ def test31_anonymous_union(self):
assert type(p.data_c[0]) == float
assert p.intensity == 5.

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

Expand Down Expand Up @@ -2167,7 +2167,6 @@ def test43_ccharp_memory_handling(self):
assert b.name == 'pqr'
assert b.val == 5

@mark.xfail
def test44_buffer_memory_handling(self):
"""cppyy side handled memory of LL buffers"""

Expand Down
7 changes: 3 additions & 4 deletions test/test_doc_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,8 @@ def test08_voidptr_array(self):
assert n.p[1] == 0x2
assert n.p[2] == 0x3
assert len(n.p) == 3

@mark.xfail(run=not IS_CLANG_DEBUG, reason="Crashes with ClangRepl with 'toString not implemented'")
@mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes with ClangRepl with 'toString not implemented'")
def test09_custom_str(self):
"""Example of customized str"""

Expand Down Expand Up @@ -1145,7 +1145,6 @@ def add(self, i):

assert v.back().add(17) == 4+42+2*17

@mark.skipif(not IS_CLANG_REPL, reason="=Enabled with CppInterOp template-fix but has not been tested on Cling")
def test_fallbacks(self):
"""Template instantation switches based on value sizes"""

Expand All @@ -1164,7 +1163,7 @@ def test_fallbacks(self):
assert CC.passT(2**64-1) == 2**64-1
assert 'unsigned long long' in CC.passT.__doc__

@mark.xfail(run=not IS_CLANG_REPL, reason="Crashes otherwise")
@mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes on Clang-REPL")
def test_callbacks(self):
"""Function callback example"""

Expand Down
1 change: 0 additions & 1 deletion test/test_eigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def setup_class(cls):
warnings.simplefilter('ignore')
cppyy.include('Eigen/Dense')

@mark.skipif(not IS_CLANG_REPL, reason="=Enabled with CppInterOp template-fix but has not been tested on Cling")
def test01_use_of_Map(self):
"""Use of Map (used to crash)"""

Expand Down
2 changes: 1 addition & 1 deletion test/test_fragile.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test07_unnamed_enum(self):

g = fragile.G()

@mark.xfail(run=not IS_CLANG_REPL, reason="Crashes on ClangRepl")
@mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes on Clang-REPL")
def test08_unhandled_scoped_datamember(self):
"""Test that an unhandled scoped data member does not cause infinite recursion"""

Expand Down
9 changes: 2 additions & 7 deletions test/test_leakcheck.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import py, os, sys
from pytest import mark, skip
from .support import setup_make, pylong, pyunicode
from .support import setup_make, pylong, pyunicode, IS_CLANG_REPL

currpath = py.path.local(__file__).dirpath()
test_dct = str(currpath.join("datatypesDict"))
Expand Down Expand Up @@ -68,7 +68,6 @@ def check_func(self, scope, func, *args, **kwds):
gc.collect()
assert last == self.process.memory_info().rss

@mark.xfail
def test01_free_functions(self):
"""Leak test of free functions"""

Expand All @@ -94,7 +93,6 @@ def test01_free_functions(self):
self.check_func(ns, 'free_f_ret1')
self.check_func(ns, 'free_f_ret1')

@mark.xfail
def test02_test_static_methods(self):
"""Leak test of static methods"""

Expand All @@ -121,7 +119,6 @@ class MyClass02 {
self.check_func(m, 'static_method_ol', 42., tmpl_args='float')
self.check_func(m, 'static_method_ret')

@mark.xfail
def test03_test_methods(self):
"""Leak test of methods"""

Expand All @@ -148,7 +145,6 @@ class MyClass03 {
self.check_func(m, 'method_ol', 42., tmpl_args='float')
self.check_func(m, 'method_ret')

@mark.xfail
def test04_default_arguments(self):
"""Leak test for functions with default arguments"""

Expand Down Expand Up @@ -190,7 +186,7 @@ class MyClass04 {
self.check_func(m, 'method_default', b=-99)
self.check_func(m, 'method_default', c=-99)

@mark.xfail
@mark.skipif(IS_CLANG_REPL, reason="Seg faults on Clang when entire test suite is run, passes if only test_leakcheck is run")
def test05_aggregates(self):
"""Leak test of aggregate creation"""

Expand Down Expand Up @@ -222,7 +218,6 @@ def test05_aggregates(self):
self.check_func(ns, 'SomeBuf')
self.check_func(ns, 'SomeBuf', val=10, name="aap", buf_type=ns.SHAPE)

@mark.xfail
def test06_dir(self):
"""Global function uploads used to cause more function generation"""

Expand Down
2 changes: 1 addition & 1 deletion test/test_lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test05_array_as_ref(self):
f = array('f', [0]); ctd.set_float_r(f); assert f[0] == 5.
f = array('d', [0]); ctd.set_double_r(f); assert f[0] == -5.

@mark.skipif(not IS_CLANG_REPL, reason="Fails on Cling")
@mark.skipif(not IS_CLANG_REPL, reason="Crashes on Cling")
def test06_ctypes_as_ref_and_ptr(self):
"""Use ctypes for pass-by-ref/ptr"""

Expand Down
10 changes: 4 additions & 6 deletions test/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def test04_avx(self):
assert cppyy.cppdef('int check_avx() { return (int) __AVX__; }')
assert cppyy.gbl.check_avx() # attribute error if compilation failed

@mark.skipif(not IS_CLANG_REPL, reason = "Fails on Cling")
def test05_default_template_arguments(self):
"""Calling a templated method on a templated class with all defaults used to crash."""

Expand Down Expand Up @@ -228,7 +227,7 @@ def test09_gil_not_released(self):
cppyy.cppdef(code)
cppyy.gbl.some_foo_calling_python()

@mark.skipif(not IS_CLANG_REPL, reason="Crashes otherwise")
@mark.skipif(not IS_CLANG_REPL, reason="Crashes on Cling")
def test10_enum_in_global_space(self):
"""Enum declared in search.h did not appear in global space"""

Expand Down Expand Up @@ -858,7 +857,6 @@ def changeCallback(self, b):
g.triggerChange()
assert g.success

@mark.xfail
def test30_uint64_t(self):
"""Failure due to typo"""

Expand Down Expand Up @@ -1003,7 +1001,7 @@ class ReferenceWavefunction {};
pt_type = cppyy.gbl.property_types.ReferenceWavefunction['double']
assert cppyy.gbl.std.get[0](cppyy.gbl.property_types.run_as[pt_type]()) == 20.

@mark.xfail(run=not IS_CLANG_DEBUG, reason="Crashes with ClangRepl with 'toString not implemented'")
@mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes with ClangRepl with 'toString not implemented'")
def test34_print_empty_collection(self):
"""Print empty collection through Cling"""

Expand All @@ -1013,7 +1011,7 @@ def test34_print_empty_collection(self):
v = cppyy.gbl.std.vector[int]()
str(v)

@mark.skipif(not IS_CLANG_REPL, reason="Crashes otherwise")
@mark.skipif(not IS_CLANG_REPL, reason="Crashes on Cling")
def test35_filesytem(self):
"""Static path object used to crash on destruction"""

Expand Down Expand Up @@ -1143,7 +1141,7 @@ def test38_char16_arrays(self):
assert ai.name[:5] == u'hello'
cppyy.ll.array_delete(aa)

@mark.xfail(run=not IS_CLANG_DEBUG, reason="Crashes with Clang-Repl with assert in CodeGen::CodeGenFunction::EmitAggExpr")
@mark.xfail(run=False, reason="Crashes with Clang-Repl with assert in CodeGen::CodeGenFunction::EmitAggExpr")
def test39_vector_of_pointers_conversion(self):
"""vector<T*>'s const T*& used to be T**, now T*"""

Expand Down
6 changes: 3 additions & 3 deletions test/test_stltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,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=not IS_CLANG_DEBUG, reason="Crashes with ClangRepl with 'toString not implemented'")
@mark.xfail(condition=IS_CLANG_REPL, run=False, reason="Crashes with ClangRepl with 'toString not implemented'")
def test05_stlstring_and_unicode(self):
"""Mixing unicode and std::string"""

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

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

Expand Down Expand Up @@ -1588,7 +1588,7 @@ def setup_class(cls):
import cppyy
cls.stltypes = cppyy.load_reflection_info(cls.test_dct)

@mark.skipif(not IS_CLANG_REPL, reason="Fails on Cling")
@mark.xfail(condition=not IS_CLANG_REPL, reason="xfail on Cling")
def test01_string_through_string_view(self):
"""Usage of std::string_view as formal argument"""

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

@mark.skipif(not IS_CLANG_REPL, reason="=Enabled with CppInterOp template-fix but has not been tested on Cling")
def test01_template_member_functions(self):
"""Template member functions lookup and calls"""

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

assert tc(5) == 5.

@mark.skipif(not IS_CLANG_REPL, reason="=Enabled with CppInterOp template-fix but has not been tested on Cling")
def test10_templated_hidding_methods(self):
"""Test that base class methods are not considered when hidden"""

Expand Down Expand Up @@ -342,7 +340,7 @@ def test13_using_templated_method(self):
assert type(d.get3()) == int
assert d.get3() == 5

@mark.xfail
@mark.xfail(condition=IS_CLANG_REPL, reason="Fails on Clang-REPL")
def test14_templated_return_type(self):
"""Use of a templated return type"""

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

assert cppyy.gbl.TemplatedCtor.C(0)

@mark.xfail
def test21_type_deduction_with_conversion(self):
"""Template instantiation with [] -> std::vector conversion"""

Expand Down Expand Up @@ -565,7 +562,7 @@ def test21_type_deduction_with_conversion(self):
assert l2v.test3[int]([d1]) == 1
assert l2v.test3[int]([d1, d1]) == 2

@mark.xfail
@mark.xfail(condition=IS_CLANG_REPL, reason="Fails on Clang-REPL")
def test22_type_deduction_of_proper_integer_size(self):
"""Template type from integer arg should be big enough"""

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

@mark.skipif(not IS_CLANG_REPL, reason="=Enabled with CppInterOp template-fix but has not been tested on Cling")
def test23_overloaded_setitem(self):
"""Template with overloaded non-templated and templated setitem"""

Expand Down

0 comments on commit 8e5ccb4

Please sign in to comment.