28

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:


What's the difference?

Filip Roséen - refp
  • 62,493
  • 20
  • 150
  • 196
user3338893
  • 917
  • 3
  • 10
  • 17

1 Answers1

36

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).

sigy
  • 2,408
  • 1
  • 24
  • 55