Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthospap authored Dec 16, 2024
1 parent 1618ab7 commit 377bc1b
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions test/should_not_compile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,19 @@ add_test(
## Note that the error message is compiler-specific ...
##
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set_tests_properties(fail-build-fractional-seconds-op-equal PROPERTIES
PASS_REGULAR_EXPRESSION "'?FractionalSeconds'?\\s+and\\s+'?double'?"
)
# Extract the Clang version as a list of major, minor, patch
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15.0.0")
# For Clang versions less than 15.0.0
set_tests_properties(fail-build-datetime-diff-type PROPERTIES
PASS_REGULAR_EXPRESSION "invalid operands to binary expression"
)
else()
# For Clang versions 15.0.0 or newer
set_tests_properties(fail-build-datetime-diff-type PROPERTIES
PASS_REGULAR_EXPRESSION "'?FractionalSeconds'?\\s+and\\s+'?double'?"
)
endif()

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set_tests_properties(fail-build-fractional-seconds-op-equal PROPERTIES
PASS_REGULAR_EXPRESSION "no match for ‘operator==’"
Expand All @@ -51,9 +61,18 @@ add_test(
)

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set_tests_properties(fail-build-fractional-seconds-op-greater PROPERTIES
PASS_REGULAR_EXPRESSION "'?FractionalSeconds'?\\s+and\\s+'?double'?"
)
# Extract the Clang version as a list of major, minor, patch
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "15.0.0")
# For Clang versions less than 15.0.0
set_tests_properties(fail-build-datetime-diff-type PROPERTIES
PASS_REGULAR_EXPRESSION "invalid operands to binary expression"
)
else()
# For Clang versions 15.0.0 or newer
set_tests_properties(fail-build-datetime-diff-type PROPERTIES
PASS_REGULAR_EXPRESSION "'?FractionalSeconds'?\\s+and\\s+'?double'?"
)
endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set_tests_properties(fail-build-fractional-seconds-op-greater PROPERTIES
PASS_REGULAR_EXPRESSION "no match for ‘operator>’"
Expand Down

0 comments on commit 377bc1b

Please sign in to comment.