user3338893
user3338893

Reputation: 977

GCOV: What is the difference between --coverage and --ftest-coverage when building with GCC?

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?

Upvotes: 28

Views: 23614

Answers (1)

sigy
sigy

Reputation: 2500

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

Upvotes: 38

Related Questions