Skip to content

Commit

Permalink
disable C++17 tests when using C++14
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Nov 11, 2023
1 parent 69028db commit c456d27
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ def setup_class(cls):
import cppyy
cls.templates = cppyy.load_reflection_info(cls.test_dct)

at_least_17 = 201402 < cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;")
cls.has_integral_v = at_least_17
cls.has_disjunction_v = at_least_17
cls.has_pack_fold = at_least_17

def test00_template_back_reference(self):
"""Template reflection"""

Expand Down Expand Up @@ -301,9 +306,10 @@ def test12_template_aliases(self):
assert nsup.make_vector[int , 4]().m_val == 4

# with inner types using
assert cppyy.gbl.gInterpreter.CheckClassTemplate("using_problem::Bar::Foo")
assert nsup.Foo
assert nsup.Bar.Foo # used to fail
if cppyy.gbl.gInterpreter.ProcessLine("__cplusplus;") > 201402:
assert cppyy.gbl.gInterpreter.CheckClassTemplate("using_problem::Bar::Foo")
assert nsup.Foo
assert nsup.Bar.Foo # used to fail

def test13_using_templated_method(self):
"""Access to base class templated methods through 'using'"""
Expand Down Expand Up @@ -492,6 +498,9 @@ class CustomVec {
def test20_templated_ctor_with_defaults(self):
"""Templated constructor with defaults used to be ignored"""

if not self.has_integral_v:
return

import cppyy

cppyy.cppdef("""\
Expand Down Expand Up @@ -724,6 +733,9 @@ def test26_partial_templates(self):
def test27_variadic_constructor(self):
"""Use of variadic template function as contructor"""

if not self.has_disjunction_v:
return

import cppyy

cppyy.cppdef("""\
Expand Down Expand Up @@ -1128,6 +1140,9 @@ def test33_using_template_argument(self):
def test34_cstring_template_argument(self):
"""`const char*` use over std::string"""

if not self.has_pack_fold:
return

import cppyy
import ctypes

Expand Down

0 comments on commit c456d27

Please sign in to comment.