bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating code coverage reports


From: Simon Josefsson
Subject: Re: Generating code coverage reports
Date: Mon, 03 Nov 2008 12:22:44 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

ludo-mXXj517/address@hidden (Ludovic Courtès) writes:

> Hi Simon,
>
> Simon Josefsson <address@hidden> writes:
>
>> +COVERAGE_CCOPTS ?= "-g -fprofile-arcs -ftest-coverage"
>
> Looks to me that `--coverage' is more appropriate as it adds all `-f'
> options that are needed, so it's potentially more "future-proof".
>
> Also, LDFLAGS must be modified to do either `-lgcov' or, again,
> `--coverage'.

Hi Ludovic.  Thanks, I pushed this patch.  Adding anything to LDFLAGS
doesn't seem to be required though?

Btw, it is better/worse to compile with -O2?  It may be better for
profiling optimizations, but the use-case here is to generate code
coverage reports for the self tests.  So I would assume -O2 is harmful
here.  Whether -g is useful or not is another question.

/Simon

>From dfb03f6cae852d6d9bfc7e986b942d0b81e06dff Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Mon, 3 Nov 2008 12:20:18 +0100
Subject: [PATCH] maint.mk: Use --coverage.

---
 ChangeLog    |    6 ++++++
 top/maint.mk |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa7493c..6a42c87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-03  Simon Josefsson  <address@hidden>
+
+       * top/maint.mk (COVERAGE_CCOPTS): Use --coverage instead of
+       -fprofile-arcs -ftest-coverage.  Suggested by Ludovic Courtès
+       <address@hidden>.
+
 2008-11-02  Bruno Haible  <address@hidden>
 
        Mark 'strpbrk' obsolete.
diff --git a/top/maint.mk b/top/maint.mk
index 2eea98d..62f3a41 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -111,7 +111,7 @@ init-coverage:
        make clean
        lcov --directory . --zerocounters
 
-COVERAGE_CCOPTS ?= "-g -fprofile-arcs -ftest-coverage"
+COVERAGE_CCOPTS ?= "-g --coverage"
 COVERAGE_OUT ?= doc/coverage
 
 build-coverage:
-- 
1.5.6.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]