- Notifications
You must be signed in to change notification settings - Fork70
Refactor ccov target dependencies tree#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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
if(NOT TARGET ccov-html) | ||
add_custom_target(ccov-html) | ||
endif() | ||
add_dependencies(ccov-html ccov-html-${target_code_coverage_COVERAGE_TARGET_NAME}) | ||
StableCoderMay 9, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
ccov-html/ccov-html-$TARGET_NAME is only available for GCC with this change. But because it's here, it's being added for both GCC and Clang. Can this be shifted down into the if(GNU) section just underneath?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oh, I missed that, will fix it.
Problem for me was that e.g. calling
ccov-capture-TARGET
was doing much more than the name was telling, e.g. it was cleaning all coverage data collected until then. Alsoccov
was doing the same for all targets.I draw the targets dependencies tree (
-
- is a target dependency,+
is extra action done by the target):So calling
ccov
was going down the tree and removing and regenerating everything. So any extra changes done in the meantime like manually called targets with special options were lost.So I change the hierarchy into this (
(**)
denotes new targets):So now
ccov-clean-TARGET
just clean,ccov-capture-TARGET
just captures the data, butccov
does all of them so it is backward compatible. The new targetccov-html-TARGET
captures the data and generates html. Here I made exception that-html
calls-capture
because this makes sense. Theccov-clean-TARGET
is new and it sole purpose is to remove files. Task which was previously done byccov-capture-TARGET
.Similar change I made for
ccov-all-*
targets. Old scheme was:new scheme is
Now I can just run my targets in a custom way and call
make ccov-all-html
to collect data. Previously it was not possible.