-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
doctest_discover_tests and FetchContent_Declare #351
Comments
Perhaps its similar to what one would do when using Catch2. However, I'm not familiar so I'd appreciate it if someone else helps out with this. |
This eventually started working. Posting current solution here incase anyone else has the same issue. Not sure what the solution ended up being. I think I had some random issue that solved itself, sorry about that.
|
@ChristofferGreen I have followed your approach and have managed to produce a valid CMake file which contains
If I remove |
It sounds like there is some error in the c++ code, the error message says that main is returning 0xc0000139, anything above 0 is an error. |
@ChristofferGreen Thanks for your comment. I'm confused because no error is produced when I run my test executable. The test file cannot be run only when I attempt to use Here is minimal example of a CMakeLists.txt file illustrating the problem (see the last line). I have used the factorial function from the doctest homepage. I am running on Windows 10, using VS Code:
|
Here is
Output with the last line commented:
Output with the last line uncommented:
|
Hi
Using FetchContent_Declare/FetchContent_MakeAvailable it's possible to download doctest and use it from cmake without having it pre-installed or packaged with your project.
It's not clear to me however how to use the doctest_discover_tests functionality https://github.com/onqtam/doctest/blob/master/scripts/cmake/doctest.cmake when using FetchContent_Declare/FetchContent_MakeAvailable. Does anyone know?
The closest I have gotten is to do:
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
doctest_discover_tests(ProjectName)
But -P "${_DOCTEST_DISCOVER_TESTS_SCRIPT}" does not get set correctly.
Thank you
The text was updated successfully, but these errors were encountered: