-----BEGIN PGP SIGNED MESSAGE----- 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 difficult. > > You might need this additional diff for Devel::Cover to work right: > > | --- a/lib/Autom4te/General.pm > | +++ b/lib/Autom4te/General.pm > | @@ -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. Agreed. > Perl coverage convenience targets. > > * Makefile.am (PERL_COVERAGE_DB, PERL_COVERAGE_FLAGS, PERL_COVER): > 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 e...@byu.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkrcV/sACgkQ84KuGfSFAYC4FACeL5KpEkFjGY7CAHByKEzkwzLg C0YAn3wEl8wo8lyIGfEKfhzgT015CQrL =siFT -----END PGP SIGNATURE-----