[apparmor] [patch 7/8] parser - add build option for coverage

Steve Beattie steve at nxnw.org
Tue Dec 3 18:18:31 UTC 2013


On Wed, Nov 27, 2013 at 06:10:43PM -0800, Seth Arnold wrote:
> On Wed, Oct 23, 2013 at 06:41:51PM -0700, Steve Beattie wrote:
> > This patch adds a parser make variable and a make target for building
> > the compiler with coverage compilation flags. With this, coverage
> > information can be generated by running tests/test suites against the
> > built parser and run through tools like gcovr.
> 
> Very cool, several small comments inline:

Thanks for the feedback, I've incorporated most of your comments into my
patch (to be resubmitted shortly).

> >   v1: initial version
> >   v2: refreshed/no change
> > 
> > Signed-off-by: Steve Beattie <steve at nxnw.org>
> > ---
> >  parser/Makefile                |    8 +++++++-
> >  parser/libapparmor_re/Makefile |    2 +-
> >  parser/tst/Makefile            |    1 +
> >  3 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > Index: b/parser/Makefile
> > ===================================================================
> > --- a/parser/Makefile
> > +++ b/parser/Makefile
> > @@ -51,6 +51,9 @@ CFLAGS	= -g -O2 -pipe
> >  ifdef DEBUG
> >  CFLAGS += -pg -D DEBUG
> >  endif
> > +ifdef COVERAGE
> > +CFLAGS = -g -pg -fprofile-arcs -ftest-coverage
> > +endif
> >  endif #CFLAGS
> 
> We've got CFLAGS += and CFLAGS = in these now -- should we change them all
> to CFLAGS = just for being bluntly verbose?

The Makefile needs a bit of cleanup and rethinking around CFLAGS,
CXXFLAGS, et al. But I think it's a bit beyond the scope of this patch.

Ideally, sane variable setting for building with
debugging/profiling/coverage would come with configuration time
options in the eventual conversion to autotools or cmake.

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20131203/ee28d22a/attachment.pgp>


More information about the AppArmor mailing list