Skip to content

Commit

Permalink
Add test for c++17 and <variant>
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristosT committed Apr 15, 2024
1 parent 0e46d2e commit 9bc0bb3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions unittests/data/cpp_standard_17.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2014-2017 Insight Software Consortium.
// Copyright 2004-2009 Roman Yakovenko.
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt

// See https://github.com/CastXML/pygccxml/issues/180
// variant introduced in C++17
#include <variant>
std::variant<int, double, float> value;
9 changes: 9 additions & 0 deletions unittests/test_cpp_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ def test(self):
RuntimeError,
lambda: parser.parse(["cpp_standards.hpp"], self.config))

def test_cpp17(self):
"""
Test c++17 by setting cflags.
"""

self.config.cflags = "-std=c++17"
parser.parse(["cpp_standard_17.hpp"], self.config)


def create_suite():
suite = unittest.TestSuite()
Expand Down

0 comments on commit 9bc0bb3

Please sign in to comment.