gcc Code coverage: gcov Introduction

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Code coverage is a measure used to how often each source code statement and branch is executed. This measure is usually required when running a test suite to ensure that as much of the code as possible is tested by the test suite. It can also be used during profiling to determine code hot-spots and thus where optimization efforts may have the most effect.

In GCC code coverage is provided by the gcov utility. gcov works only with code compiled with gcc with particular flags. There are very few other compilers with which gcov works at all.



Got any gcc Question?