Skip to content
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

TOOLS: add support for GCOV code coverage tool #10635

Closed
wants to merge 1 commit into from

Conversation

davidbuzz
Copy link
Collaborator

... and HTML coverage reporting with LCOV.

first, "apt install gcovr lcov" as new prerequisites
then run:
./waf configure --enable-gcov
./waf build --lcov-report
and after much waiting review the report in HTML format with your preferred browser eg:
firefox reports/lcov-report/index.html

…h LCOV.

first, "apt install gcovr lcov" as new prerequisites 
then run:
./waf configure --enable-gcov
./waf build --lcov-report 
and after much waiting review the report in HTML format with your preferred browser eg:
firefox reports/lcov-report/index.html
@peterbarker
Copy link
Contributor

Red for the waf output seems a bit extreme.

This looks awesome.

@peterbarker
Copy link
Contributor

... commit mesage should have Tools rather than TOOLS

@peterbarker
Copy link
Contributor

I didn't get any REPORTS directory at the end of it.

LCOV/GCOV -> fly.ArduCopter started.... this will take quite some time...
Coverage Tests Executing:( ./Tools/autotest/autotest.py --debug --no-configure fly.ArduCopter )  > ./GCOV_fly.ArduCopter.log
LCOV/GCOV -> fly.ArduCopter see ./GCOV_fly.ArduCopter.log for log of activity)

real	15m39.686s
user	15m17.225s
sys	3m51.912s
pbarker@recursion:~/rc/ardupilot(coverage)$ echo $DISPLAY

Some of the tests failed - do they have to succeed to run the report generation?

@khancyr
Copy link
Contributor

khancyr commented Feb 26, 2019

I really enjoy this, but should we put those function into a new file into ardupilowaf directory to keep the root wscript simple ?

@davidbuzz
Copy link
Collaborator Author

Peter, yes, all tests have to pass to get a report, why is your fly.Arducopter failing, mine doesn't. Check the output in ./GCOV*.log to see why.

@davidbuzz
Copy link
Collaborator Author

Khancyr, I'm not really a waf person, but putting the functions into subdir sounds reasonable, if possible, so I'll see what I can do .

@peterbarker
Copy link
Contributor

@davidbuzz My guess is that it comes back to the compiler options required to do the coverage analysis. They stuff the timing around sufficiently that the machine I'm trying to run it on can't cope. We're doing better over time on this front, but not there yet.

I'll try running this on my primary machine and see what happens.

@khancyr khancyr added the Tools label Feb 28, 2019
@peterbarker peterbarker mentioned this pull request Mar 4, 2019
@peterbarker
Copy link
Contributor

Merged via #10696 - awesome!

@peterbarker peterbarker closed this Mar 4, 2019
@khancyr
Copy link
Contributor

khancyr commented Mar 4, 2019

very nice !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants