Trying to get code coverage up and running, and I'm just reading documentation first. I found a few articles that mention building with the --coverage
flag, while others mention the --ftest-coverage
.
Both descriptions seem to say they do the same thing, but I'm not certain.
Here's two articles:
http://bobah.net/d4d/tools/code-coverage-with-gcov
http://www.osadl.org/Dumping-gcov-data-at-runtime-simple-ex.online-coverage-analysis.0.html
What's the difference?
Lcov is a graphical front-end for gcov. It collects gcov data for multiple source files and creates HTML pages containing the source code annotated with coverage information. It also adds overview pages for easy navigation within the file structure. Lcov supports statement, function, and branch coverage measurement.
DESCRIPTION. gcov is a test coverage program. Use it in concert with GCC to analyze your programs to help create more efficient, faster running code and to discover untested parts of your program. You can use gcov as a profiling tool to help discover where your optimization efforts will best affect your code.
As already stated in the comments --coverage
is a synonym for other flags related to code coverage depending on the context.
3.11 Program Instrumentation Options:
--coverage
This option is used to compile and link code instrumented for coverage analysis. The option is a synonym for -fprofile-arcs -ftest-coverage (when compiling) and -lgcov (when linking).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With