Use DOCTEST_* compiler macros and suppress pragmas warning (#3550)

Use DOCTEST_* macros in place of predefined compiler macros for compiler
detection and version checks.

The suppression of warning -Wrange-loop-construct in unit-items.cpp
causes GCC<11 to warn about pragmas. Suppressed by adding a version
check.
This commit is contained in:
Florian Albrechtskirchinger
2022-06-21 16:57:47 +02:00
committed by GitHub
parent 87cda1d664
commit 39e27684ea
4 changed files with 7 additions and 5 deletions

View File

@@ -34,7 +34,9 @@ using nlohmann::json;
// This test suite uses range for loops where values are copied. This is inefficient in usual code, but required to achieve 100% coverage.
DOCTEST_GCC_SUPPRESS_WARNING_PUSH
DOCTEST_GCC_SUPPRESS_WARNING("-Wrange-loop-construct")
#if DOCTEST_GCC >= DOCTEST_COMPILER(11, 0, 0)
DOCTEST_GCC_SUPPRESS_WARNING("-Wrange-loop-construct")
#endif
DOCTEST_CLANG_SUPPRESS_WARNING_PUSH
DOCTEST_CLANG_SUPPRESS_WARNING("-Wrange-loop-construct")