-
Notifications
You must be signed in to change notification settings - Fork 214
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
CTest returns non-zero when any tests fail, causing coverage to not finish #9
Comments
Yes this can be a problem. Unfortunately
Sorry I decided not to implement this because it adds a lot of complexity (functionality split into several files, generated script files in build-directory) and we run coverage only when the tests passed. I leave this issue open in case somebody else comes across this. |
I guess I don't understand which add_custom_target is doing any exit code checking? In your script you just run |
In |
I ended up with the following that seems to work. Thanks for your help!
|
The proposed solution looks quite complicated, so I have used a wrapper setup_target_for_coverage(NAME coverage EXECUTABLE ${CMAKE_SOURCE_DIR}/ctestwrapper -j ${PROCESSOR_COUNT}) and the wrapper is just resetting the exit code: #!/bin/sh ctest $@ exit 0 |
I faced the same issue and fixed it by changing Tested with cmake v3.13.3 |
As stated in the script:
However, the recommended way of running coverage analysis on all files is to make an add_custom_target that runs ctest. If any tests fail, ctest returns non-zero which causes the coverage analysis to abort. It seems reasonable to still run coverage even if there are failing tests - is there any way to get around this?
The text was updated successfully, but these errors were encountered: