-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-3094 Upgrade Catch2 from v2 to v3 #1200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1e39a30
clang-format: separate system and third-party headers from driver hea…
eramongodb 81907fa
Remove obsolete MONGO_CXX_DRIVER_COMPILING compile definition
eramongodb a3c9548
Do not build or run tests on VS 2015 distros
eramongodb afb5804
Upgrade to Catch2 v3 via FetchCatch2.cmake
eramongodb 2db84eb
Format catch_helpers.hh
eramongodb c6eaba9
Conditionally pass SYSTEM to FetchContent_Declare
eramongodb 7e7881c
Disable tests in RPM snapshot builds
eramongodb c39d841
Remove preceeding space before -Werror for consistency
eramongodb 082b5d7
Address -Wextra-semi* warnings
eramongodb 5df3591
Remove redundant Catch::Catch2 target
eramongodb d613073
Update Catch2 license in THIRD-PARTY-NOTICES to match v3.7.0
eramongodb 91d6ad9
Copyright Notice != License Notice
eramongodb 8419694
Use automatic evaluation for CMAKE_VERSION
eramongodb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Use FetchContent to obtain Catch2. | ||
|
||
include(FetchContent) | ||
|
||
message(STATUS "Downloading Catch2...") | ||
|
||
function(fetch_catch2) | ||
set(fetch_args "") | ||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.25.0") | ||
set(fetch_args "SYSTEM") | ||
endif() | ||
|
||
FetchContent_Declare( | ||
EP_Catch2 | ||
|
||
GIT_REPOSITORY https://github.com/catchorg/Catch2 | ||
GIT_TAG v3.7.0 | ||
GIT_SHALLOW TRUE | ||
LOG_DOWNLOAD ON | ||
|
||
${fetch_args} | ||
|
||
FETCHCONTENT_UPDATES_DISCONNECTED ON | ||
) | ||
|
||
FetchContent_GetProperties(EP_Catch2) | ||
|
||
if(NOT ep_catch2_POPULATED) | ||
# Avoid Catch2 compile warnings from being treated as errors. | ||
string(REPLACE " -Werror" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") | ||
string(REPLACE " -Werror" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | ||
|
||
FetchContent_MakeAvailable(EP_Catch2) | ||
|
||
# Avoid building unnecessary targets. Use FetchContent_Declare(EXCLUDE_FROM_ALL) in CMake 3.28 and newer. | ||
set_property(DIRECTORY "${ep_catch2_SOURCE_DIR}" PROPERTY EXCLUDE_FROM_ALL ON) | ||
|
||
# Catch2 config vars. | ||
set_property(CACHE CATCH_INSTALL_DOCS PROPERTY VALUE OFF) | ||
set_property(CACHE CATCH_INSTALL_EXTRAS PROPERTY VALUE OFF) | ||
endif() | ||
endfunction() | ||
|
||
fetch_catch2() | ||
|
||
message (STATUS "Downloading Catch2... done.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should
/WX
also be removed? (for MSVC)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not pass
/WX
in any of our build or CI scripts, so it is not necessary.