-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Catch2's tests should never be run, if it is loaded as a sub-project #2202
Comments
The fix is trivial: # detect if Catch is being bundled,
# disable testsuite in that case
if(NOT DEFINED PROJECT_NAME)
set(NOT_SUBPROJECT ON)
+else()
+ set(NOT_SUBPROJECT OFF)
endif() |
claremacrae
added a commit
to claremacrae/Catch2
that referenced
this issue
Apr 5, 2021
The |
claremacrae
added a commit
to claremacrae/Catch2
that referenced
this issue
Apr 5, 2021
horenmar
pushed a commit
that referenced
this issue
Apr 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note: I will submit PRs to fix this on the v2 and v3 branches... the fix is trivial
Describe the bug
Catch2's top-level
CMakeLists.txt
file has code to prevent self-tests being run if the project is being bundled e.g. viaadd_subdirectory()
orFetchContent
.However, if
NOT_SUBPROJECT
was already set toON
in a parent scope, the self-tests are still run anyway (and also the 20-30 CTest targets are added)Expected behavior
Turn off
NOT_SUBPROJECT
if Catch2 is running as a sub-projectReproduction steps
Steps to reproduce the bug.
Expected output:
Actual output - note the include of
SelfTest
, as well as all the targets generated by including CTest:Platform information:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: