I ran into a similar problem and came up with a very ugly, don't-try-this-at-home solution I posted in use.perl
my( $totals, $failed ) = eval { local @INC = @INC; local *STDOUT; # Shut up Test::Harness! local *STDERR; # Yeah, you too! my $MM = ExtUtils::MM->new(); # and you! unshift @INC, map { File::Spec->rel2abs($_) } @{ $MM }{ qw( INST_LIB INST_ARCHLIB ) }; Test::Harness::_run_all_tests( @test_files ) };

I could use Test::Harness::Straps to do this all myself, but at the time I was on a bit of a deadline and wasn't sure I could reproduce everything _run_all_tests did, so I just wrapped it.

This solution is a slightly (very slightly) easier than shelling out to `make test` and parsing the output since I only needed the percentage of tests that fail. Besides, I was curious if it would work.

To repeat: very ugly kludge for demonstration purposes only. If you truly, deeply, and sincerely need to do this sort of thing, look at Test::Harness::Straps which can run everything for you and hand you back the information. I haven't done that yet because I've been little-l lazy (or big b Busy).

--
brian d foy <bdfoy@cpan.org>

In reply to Re: redirecting output from a format by brian_d_foy
in thread redirecting output from a format by mpeters

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.