-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add build option for coverage #94
Comments
There are certainly many different cases where simplifying the command line arguments would be beneficial. I am not sure what the right approach for that would be. I don't think adding those to I would image this more like a "profile" / "config" feature. Somewhere there is a set of preconfigured options like "coverage" which defines to what existing command line options this should expand to. Maybe something like the |
@dirk-thomas I think something like the People could define an alias in the root of their workspace:
So
would expand to the long command The challenges I see are that:
|
Everyone's workflow for this kind of stuff is different but I handle this with a GitHub repo with pages of commonly used console commands. You can edit them directly on GitHub with the built-in editor, and when you want to use them, there is a convenient "Copy line" button for pasting into terminals. |
While this could be realized as a "verb alias" I do see a couple of downsides / limitations to it:
That being said I would rather like to see these kind of "configuration snippets" as mixins. So it should be able to choose multiple (assuming they don't collide / contradict each other) at the same time. So e.g. "memory sanitizer" together with "debug" or "coverage" together with "release" (not really good examples but I guess it clarifies the idea). Those "mixins" could be contributed in a similar way as the |
@dirk-thomas If I understand correctly, what you are proposing would look something like:
And the
|
Exactly - thanks for the more concrete summary 👍
I would probably lean toward
The value of each mixin should probably follow the structure in the existing meta / yaml files:
I am just not sure yet how all these aspects should play together in the bigger picture: metadata, defaults, mixins, profiles (like in |
Please see the new package colcon-mixin and the corresponding data repository colcon-mixin-repository which has a few PRs with some proposed mixins. Any feedback on this is appreciated. |
@dirk-thomas Thanks! I've created this PR which can close this issue |
Description
In order to get coverage output that can be parsed by tools like gcov, it is necessary to build with special flags:
-fprofile-arcs
and-ftest-coverage
This currently means that one must add the following arguments to
colcon build
:For example, see https://ci.ros2.org/view/nightly/job/nightly_linux_coverage/210/consoleFull
While this is manageable in a CI server, it is burdensome when trying to generate coverage locally because of the length of the argument and the subtleties of escaping the arguments for CMake.
This issue proposes adding a flag (e.g.,
--with-coverage-flags
) tocolcon build
which wraps the long arguments above.Naturally, for other supported compilers (clang?), the
with-coverage-flags
option could also handle the specific compile flags.Motivation
Expected behavior
works like
-DCOVERAGE_RUN=1
such that developers can adjust test behavior during coverage test runs.Future work
colcon test_results
to digest coverage results: e.g.,The text was updated successfully, but these errors were encountered: