hogsmill has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys,

I've got a very complicated (self-penned) test runner script that extracts all the modules in a directory tree, then uses Test::Harness::Straps to capture the output of running a test fiel against each one.

Then, I discovered Test::Class and Test::Class::Load which removes the need for all that dodgy recursive directory parsing, etc.

However, I've now got 2 issues - any ideas? Ta in advance.

  1. How do I capture the output of Test::Class->runtests in the same way I do with Test::Harness::Straps ?
  2. My script also extracts all functions from the modules, and creates a list of which have (or not) corresponding test functions that test them (so we can easily see what's been tested, at least at a basic level). Is there are way to do this with Test::Class ?

Ultimately, we'll be doing TDD, so point 2 won't be as much of an issue, but surprise, surprise, we have a *mountain* of untested code to consider first :-)

Cheers in advance,

Steve
Hogsmill

  • Comment on Capturing Output of Test::Class / Test::Class::Load

Replies are listed 'Best First'.
Re: Capturing Output of Test::Class / Test::Class::Load
by shmem (Chancellor) on Feb 05, 2008 at 19:22 UTC
    Since Test::Class uses Test::Builder - see Re: Report Test::More results using Log::Log4perl?.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}