-
Notifications
You must be signed in to change notification settings - Fork 37
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
Unexpected behavior for coverage tests #254
Comments
That is definately not the intended behavior. I will take a look, do you know what flags you built with or are you seeing that for all builds? |
So I think there has been some confusion. The coverage label is applied to almost all unit tests, the label does not indicate that the code coverage has been built with the test. As in compiler flags have been set. This is a bit challenging to address because Catch2 sets the labels in the .cpp source files, so there is no way using cmake, that I know of to alter the labels. What I think you want, and what would be ideal is to only add the coverage label when the tests are built with coverage. This can and has now been done with the regression tests because the coverage label is added in cmake. I see one possible alternative, that is to write the unit tests as cmake configuration files and let cmake insert the labels in the source files. This actually might work well. |
In a shared header file, something like:
Then, e.g.:
|
The default
CODE_COVERAGE
option is off, still the test with coverage are created by default (tested on Summit with cmake 3.14.1)The behavior I expected would be that there are no coverage tests when
CODE_COVERAGE=OFF
.The second unexpected behavior pertains to the labels.
Of the 31 tests above the "coverage" labels are assigned as follows:
This is unexpected as in the case of code coverage turned off I had expected all tests to not carry the coverage label.
@JoshuaSBrown is this what was intended to happen or is this potentially a bug
In the latter case we may want to add
if
s to thecmake/TestSetup.cmake
so that coverage tests are not added if they're turned off.The text was updated successfully, but these errors were encountered: