[Top][All Lists]

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

Re: Perl code coverage

From: Eric Blake
Subject: Re: Perl code coverage
Date: Mon, 19 Oct 2009 06:13:47 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090812 Thunderbird/ Mnenhy/

Hash: SHA1

According to Ralf Wildenhues on 10/18/2009 7:17 AM:
> Can M4 tracing be instrumented to show coverage of expanded macros?
> (I guess this ought to be fairly easy).

Yes, that seems like it might be possible.  It seems like we could
redefine m4_define to cause each macro to add itself to the set of
expanded macros on first invocation; this would work for every macro
except m4 builtins, so some care would be needed.

> Can M4/M4sugar be instrumented to map shell coverage information back
> from some random configure script to our input macro files?  That would
> be cool, but I'd have no idea how to realize it.

You're right - that starts to get much harder.  m4 -s outputs synclines,
which look like shell comments, but right now, m4 synclines only track the
point at which a macro was expanded, not where the various expansion body
portions came from.  For AC_DEFUN, we maintain a nicer stack of expansion
locations, but figuring out how to output that in shell might still be

> You might need this additional diff for Devel::Cover to work right:
> | --- a/lib/Autom4te/
> | +++ b/lib/Autom4te/
> | @@ -197,7 +197,7 @@ sub END
> |  
> |    # This is required if the code might send any output to stdout
> |    # E.g., even --version or --help.  So it's best to do it unconditionally.
> | -  if (! close STDOUT)
> | +  if (! STDOUT->flush)

Is that something we want to add unconditionally?

> WDYT?  Please note that IMHO you shouldn't delay 2.65 for any of this.


>     Perl coverage convenience targets.
>     New variables.
>     (check-coverage, check-coverage-run, check-coverage-report)
>     (clean-coverage): New phony targets.
>     (clean-local): Depend on clean-coverage.

I don't see any harm in committing this; it adds a target for those
playing with coverage, without penalizing existing targets.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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