Skip to content
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

Improve the project's setup #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

skwasniak
Copy link

  • Split covr and test targets
  • Introduce test build switch
  • Include CTest instead of enabling tests
  • Improve covr target's comment
  • Switch to LCOV and generate a nice html report
  • Use --coverage compiler flag on the target
  • Remove trailing spaces

Slawomir Kwasniak added 7 commits January 26, 2021 09:35
No need to set the global flag. Instead flag is set only for the target
that are of our interest.
LCOV seems to be a better choice as now we get a nice html report.

Note that target's name has been changed so that it describes better the
target job instead of the tool that target is using, as tool might
change in the future.
Comment describes now better what the target does, and uses build
system independent command.
`include(CTest)` is a suggested way of enabling project's tests.

Under the hood it will call `enable_testing()` but as well it will
properly configure ctest.
Project shall be configured in a way that building and running tests
can be skipped.

From now on if `-DBUILD_TESTING=OFF` is set during the build file
generation, target related to the tests won't be build.
`covr` target shall not build `test` target as otherwise the coverage
won't be calculated if there are failing tests.

Instead both target shall be build separately i.e.:

```bash
cmake --build <build_dir> --target test
cmake --build <build_dir> --target covr
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant