-
Notifications
You must be signed in to change notification settings - Fork 135
split lcov and genhtml cmake opts for the Coverage profile #224
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
base: 29.x-knots
Are you sure you want to change the base?
Changes from 2 commits
7aa60c6
39f21c9
c115fc1
e2d638f
b71b968
2c2d23e
e3e917f
97a898f
b581b44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,10 +24,19 @@ separate_arguments(LCOV_OPTS) | |
| set(LCOV_COMMAND ${LCOV_EXECUTABLE} --gcov-tool ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh ${LCOV_OPTS}) | ||
|
|
||
| find_program(GENHTML_EXECUTABLE genhtml REQUIRED) | ||
| # If HTML_OPTS is not provided, implicitly pass LCOV_OPTS to genhtml. | ||
|
|
||
| # HTML_OPTS is optionally passed via -D flag. | ||
| # If HTML_OPTS is not provided at all, implicitly pass LCOV_OPTS to genhtml. | ||
| # If HTML_OPTS is provided but empty (e.g. -DHTML_OPTS=""), use an empty list | ||
| # and do NOT inherit LCOV_OPTS. | ||
| set(_HTML_OPTS_WAS_DEFINED FALSE) | ||
|
||
| if(DEFINED HTML_OPTS) | ||
| set(_HTML_OPTS_WAS_DEFINED TRUE) | ||
| endif() | ||
| separate_arguments(HTML_OPTS) | ||
tevio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
tevio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
tevio marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| set(GENHTML_OPTS ${HTML_OPTS}) | ||
| if(NOT GENHTML_OPTS) | ||
| if(_HTML_OPTS_WAS_DEFINED) | ||
| set(GENHTML_OPTS ${HTML_OPTS}) | ||
| else() | ||
| set(GENHTML_OPTS ${LCOV_OPTS}) | ||
| endif() | ||
| set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${GENHTML_OPTS}) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -508,11 +508,15 @@ enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`: | |
| cmake -DLCOV_OPTS="--rc branch_coverage=1" -P build/Coverage.cmake | ||
| ``` | ||
|
|
||
| HTML_OPTS can be specified to provide an options override to genhtml from the default LCOV_OPTS, the program that generates the | ||
| html report from lcov: `HTML_OPTS="--exclude boost"`. | ||
| HTML_OPTS can override the genhtml options (which default to LCOV_OPTS). If HTML_OPTS is omitted, LCOV_OPTS are implicitly passed to genhtml. If HTML_OPTS is provided but empty (e.g. -DHTML_OPTS=""), no options are passed to genhtml and LCOV_OPTS are not inherited. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May want to add an example showing combined use of both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if |
||
|
|
||
| Examples: | ||
| ``` | ||
| cmake -DHTML_OPTS="--exclude boost" -P build/Coverage.cmake | ||
| # Override genhtml options explicitly | ||
| cmake -DHTML_OPTS="--title 'Knots Coverage'" -P build/Coverage.cmake | ||
|
|
||
| # Provide an empty override: pass nothing to genhtml (do not inherit LCOV_OPTS) | ||
| cmake -DHTML_OPTS="" -P build/Coverage.cmake | ||
| ``` | ||
|
|
||
| To enable test parallelism: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.