Merge lp:~mrazik/unity/coverage-support into lp:unity
| Status: | Merged |
|---|---|
| Approved by: | Jussi Pakkanen on 2012-11-29 |
| Approved revision: | 2938 |
| Merged at revision: | 2941 |
| Proposed branch: | lp:~mrazik/unity/coverage-support |
| Merge into: | lp:unity |
| Diff against target: |
29 lines (+19/-0) 1 file modified
CMakeLists.txt (+19/-0) |
| To merge this branch: | bzr merge lp:~mrazik/unity/coverage-support |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jussi Pakkanen (community) | 2012-11-27 | Approve on 2012-11-29 | |
| PS Jenkins bot | continuous-integration | Pending | |
| Thomas Voß | 2012-11-28 | Pending | |
|
Review via email:
|
|||
Commit Message
Adding -DCMAKE_
Description of the Change
= Problem description =
This adds code coverage support to the build system by adding -DCMAKE_
= The fix =
CMakeLists.txt only change.
= Test coverage =
Build with -DCMAKE_
https:/
Build log without -DCMAKE_
https:/
| Jussi Pakkanen (jpakkane) wrote : | # |
Also, the comment says "gcovr cannot write directly to a file", but 'gcovr -h' prints the following:
-o OUTPUT, --output=OUTPUT Print output to this filename
Does this not work? Does it not do the correct thing? Or is there something else afoot?
| Martin Mrazik (mrazik) wrote : | # |
> Also, the comment says "gcovr cannot write directly to a file", but 'gcovr -h'
> prints the following:
>
> -o OUTPUT, --output=OUTPUT Print output to this filename
>
> Does this not work? Does it not do the correct thing? Or is there something
> else afoot?
Thomas, can you answer this? I've copy&pasted this part from your project.
| Martin Mrazik (mrazik) wrote : | # |
> The if clause on line 18 is incorrect and always evaluates to true. It should
> be written like this:
>
> if (NOT GCOVR_EXECUTABLE)
>
> Also, trying to run coverity tests without gcovr is an error. It does not
> provide any useful data, and only wastes time. The build system should stop
> with an error. This is simple, just change line 19 to this:
>
> message(FATAL_ERROR "Cannot enable coverage targets because gcovr was not
> found.")
Thanks. These are fixed.
| Jussi Pakkanen (jpakkane) wrote : | # |
I can't run make check because it errors out with "No rule to make target `../tests/
It would be nice if this was done automatically (by e.g. having a dependency between coverity-xml and tests) but I assume that Jenkins will automatically run these in the correct order so adding the dependency would run the tests twice.
This is not a blocker in any case, just would-be-
| Martin Mrazik (mrazik) wrote : | # |
Setting to WIP as I forgot about the MP and I'm using this branch in the jenkins job for a test. I'll switch back to Needs Review once I'm finished with the testing.
| Martin Mrazik (mrazik) wrote : | # |
> Also, the comment says "gcovr cannot write directly to a file", but 'gcovr -h'
> prints the following:
>
> -o OUTPUT, --output=OUTPUT Print output to this filename
>
> Does this not work? Does it not do the correct thing? Or is there something
> else afoot?
Fixed and here is a sample run with it:
https:/
| Martin Mrazik (mrazik) wrote : | # |
> I can't run make check because it errors out with "No rule to make target
> `../tests/
> I just run "make coverage-xml", I get an XML file with no real content in it.
>
> It would be nice if this was done automatically (by e.g. having a dependency
> between coverity-xml and tests) but I assume that Jenkins will automatically
> run these in the correct order so adding the dependency would run the tests
> twice.
>
> This is not a blocker in any case, just would-be-
I would prefer to leave this is up to you guys. TBH a coverage-html target should be also created (which would be using lcov) so you can check the coverage locally as well. This is a minimal support for coverage for jenkins. Not much more than that.
| Jussi Pakkanen (jpakkane) wrote : | # |
You really should not do 'cd "${CMAKE_
Once this is fixed, this is ready to merge.
- 2938. By Martin Mrazik on 2012-11-29
-
removing an unnecessary cd $CMAKE_BINARY_DIR
| Martin Mrazik (mrazik) wrote : | # |
Done.


The if clause on line 18 is incorrect and always evaluates to true. It should be written like this:
if (NOT GCOVR_EXECUTABLE)
Also, trying to run coverity tests without gcovr is an error. It does not provide any useful data, and only wastes time. The build system should stop with an error. This is simple, just change line 19 to this:
message(FATAL_ERROR "Cannot enable coverage targets because gcovr was not found.")