-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into concurrency-options
- Loading branch information
Showing
5 changed files
with
164 additions
and
187 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,36 +1,23 @@ | ||
if (NOT TARGET doctest::doctest) | ||
if (NOT TARGET gtest_main) | ||
include(FetchContent) | ||
FetchContent_Declare(doctest | ||
GIT_REPOSITORY https://github.com/doctest/doctest | ||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG main | ||
) | ||
FetchContent_MakeAvailable(doctest) | ||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) | ||
FetchContent_MakeAvailable(googletest) | ||
endif() | ||
|
||
# These two are painfully not easily accessed. | ||
# TODO: CAPPLE submitted a PR that got accepted into doctest, switch to that newer version when we can | ||
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake) | ||
set(_DOCTEST_DISCOVER_TESTS_SCRIPT "${_DOCTEST_DISCOVER_TESTS_SCRIPT}" CACHE PATH "Path to doctest cmake helper file" FORCE) | ||
|
||
target_compile_definitions(doctest | ||
INTERFACE | ||
DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN | ||
DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING | ||
) | ||
|
||
add_executable(rtlog_tests test_rtlog.cpp) | ||
|
||
target_link_libraries(rtlog_tests | ||
PRIVATE | ||
doctest::doctest | ||
gtest_main | ||
rtlog::rtlog | ||
) | ||
|
||
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED ON) | ||
|
||
if (CMAKE_GENERATOR STREQUAL "Xcode") | ||
add_test(NAME rtlog_tests COMMAND rtlog_tests) | ||
else() | ||
doctest_discover_tests(rtlog_tests) | ||
endif() | ||
|
||
|
||
include(GoogleTest) | ||
gtest_discover_tests(rtlog_tests) |
Oops, something went wrong.