[Bug gcov-profile/94636] New: gcov should and could output overall coverage. This is just a 2 code lines change.

okannen at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Apr 17 11:35:25 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94636

            Bug ID: 94636
           Summary: gcov should and could output  overall coverage. This
                    is just a 2 code lines change.
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: easyhack
          Severity: normal
          Priority: P3
         Component: gcov-profile
          Assignee: unassigned at gcc dot gnu.org
          Reporter: okannen at gmail dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48301
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48301&action=edit
Patch to output overall coverage

Gcov could output the computed overall code coverage when processing multiple
file. This overall coverage is often all what is needed in CI reports.

It think this is just a 2 lines change. 

diff --git a/gcc/gcov.c b/gcc/gcov.c
index a291bac3e9e..c16895e640a 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -1510,7 +1510,8 @@ generate_results (const char *file_name)
        }
     }

-  if (!file_name)
+    if (file_name)
+       fnotice(stdout,"Overall:\n");
     executed_summary (total_lines, total_executed);
 }


More information about the Gcc-bugs mailing list