> The gcov function summaries only output the covered lines, not the
> branches and calls. Since the function summaries is an opt-in it
> probably makes sense to also include branch coverage, calls, and
> condition coverage.
> 
> $ gcc --coverage -fpath-coverage hello.c -o hello
> $ ./hello
> 
> Before:
>     $ gcov -f hello
>     Function 'main'
>     Lines executed:100.00% of 4
> 
>     Function 'fn'
>     Lines executed:100.00% of 7
> 
>     File 'hello.c'
>     Lines executed:100.00% of 11
>     Creating 'hello.c.gcov'
> 
> After:
>     $ gcov -f hello
>     Function 'main'
>     Lines executed:100.00% of 3
>     No branches
>     Calls executed:100.00% of 1
> 
>     Function 'fn'
>     Lines executed:100.00% of 7
>     Branches executed:100.00% of 4
>     Taken at least once:50.00% of 4
>     No calls
> 
>     File 'hello.c'
>     Lines executed:100.00% of 10
>     Creating 'hello.c.gcov'
> 
>     Lines executed:100.00% of 10
> 
> With conditions:
>     $ gcov -fg hello
>     Function 'main'
>     Lines executed:100.00% of 3
>     No branches
>     Calls executed:100.00% of 1
>     No conditions
> 
>     Function 'fn'
>     Lines executed:100.00% of 7
>     Branches executed:100.00% of 4
>     Taken at least once:50.00% of 4
>     Condition outcomes covered:100.00% of 8
>     No calls
> 
>     File 'hello.c'
>     Lines executed:100.00% of 10
>     Creating 'hello.c.gcov'
> 
>     Lines executed:100.00% of 10
> 
> gcc/ChangeLog:
> 
>       * gcov.cc (generate_results): Count branches, conditions.
>       (function_summary): Output branch, calls, condition count.

OK.
Honza

Reply via email to