catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Apply PR #2297 to devel branch (#2300)
- Commit
06cf2a4724d74af88c0a4a9a7445424cc831afd6- Author
- Alecto Irene Perez ·
- Committer
- GitHub
- Parents
4436a604566f
Changes
tests/SelfTest/UsageTests/Message.tests.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/SelfTest/UsageTests/Message.tests.cpp b/tests/SelfTest/UsageTests/Message.tests.cpp index a30c2e9e..97ac4abd 100644 --- a/tests/SelfTest/UsageTests/Message.tests.cpp +++ b/tests/SelfTest/UsageTests/Message.tests.cpp @@ -238,6 +238,20 @@ std::ostream& operator<<(std::ostream& out, helper_1436<T1, T2> const& helper) { return out; } +// Clang and gcc have different names for this warning, and clang also +// warns about an unused value. This warning must be disabled for C++20. +#if defined(__GNUG__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wcomma-subscript" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunknown-pragmas" +#pragma clang diagnostic ignored "-Wunknown-warning-option" +#pragma clang diagnostic ignored "-Wdeprecated-comma-subscript" +#pragma clang diagnostic ignored "-Wunused-value" +#endif + TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") { CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2], std::vector<int>{1, 2, 3}[(0, 1)], @@ -248,6 +262,10 @@ TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messag SUCCEED(); } +#ifdef __GNUG__ +#pragma GCC diagnostic pop +#endif + TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]") { CAPTURE(("comma, in string", "escaped, \", "), "single quote in string,',", "some escapes, \\,\\\\"); CAPTURE("some, ), unmatched, } prenheses {[<");