-
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 all 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,7 +24,15 @@ 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) | ||
| set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${LCOV_OPTS}) | ||
|
|
||
| # HTML_OPTS is optionally passed via -D flag. | ||
| # Default: inherit LCOV_OPTS. If HTML_OPTS is provided (even if empty), use it instead. | ||
| set(GENHTML_OPTS ${LCOV_OPTS}) | ||
|
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. Is there a reason why we can't be consistent with the naming, either |
||
| if(DEFINED HTML_OPTS) | ||
| separate_arguments(HTML_OPTS) | ||
|
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 happens if |
||
| set(GENHTML_OPTS ${HTML_OPTS}) | ||
| endif() | ||
| set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${GENHTML_OPTS}) | ||
|
|
||
| find_program(GREP_EXECUTABLE grep REQUIRED) | ||
| find_program(AWK_EXECUTABLE awk REQUIRED) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -508,6 +508,17 @@ enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`: | |
| cmake -DLCOV_OPTS="--rc branch_coverage=1" -P build/Coverage.cmake | ||
| ``` | ||
|
|
||
| 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: | ||
| ``` | ||
| # 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: | ||
| ``` | ||
| cmake -DJOBS=$(nproc) -P build/Coverage.cmake | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.