Last night at the London.pm meeting I mentioned to Nick Clark that I
was puzzling over the problem of ensuring suitable test coverage for
.xs modules, to which he kindly put me out of my misery and pointed me
at gcov.

This is the recipie I'm currently working on.  It's a little messy,
and guaranteed fragile, but it works for me, and that's a step
forwards.

In Makefile.PL add:

sub MY::postamble {
    return <<EOF
gcov:
\trm -f `basename \$(XS_FILES)`.{bb,bbg,da,o}
\t\$(MAKE) test CCFLAGS="\$(CCFLAGS) -fprofile-arcs -ftest-coverage"
\tgcov \$(XS_FILES)
EOF
}

Then C<make gcov> and poke around at the generated Foo.xs.gcov
results.

-- 
Richard Clamp <[EMAIL PROTECTED]>

Reply via email to