On 9/26/06, Tim Bunce <[EMAIL PROTECTED]> wrote:
So the simple existence of a test.pl file prevents CPAN::Reporter
capturing the output of the t/*.t tests?

Right now CPAN::Reporter only checks for test.pl, it doesn't also check for  t/*.t.  That will probably go into the next release in some form.

>    I'll grant it needs a better diagnostic.

True :)

I feel CPAN::Reporter::FAQ becoming a necessity soon.

>    Or do I need to prioritize getting some sort of output capture even
>    in the case of test.pl?  In this case, since t/*.t is run as well,
>    the Test::Harness "All tests successful" line would get picked up
>    and the the results of test.pl would be ignored.

That seems like the best approach. Make won't run test.pl is any of the
t/*.t tests failed. So if you know that none failed but make failed
then you'll know it was test.pl that failed.

It's still tricky.  If I tee to both show the output to the user and collect the output, then I can parse for Test::Harness success/failure messages, but the actual exit code of test.pl is ignored.  If I don't tee and don't capture, then users see everything, but all I have is the result of the last thing that ran (harness on t/*.t or else test.pl itself).  If I capture without teeing, then I have both the results to parse and the exit code, but users see a blank screen while it runs.  Having test.pl run blanked out will cause problems with things like Term::Readline::Perl, which have a test.pl that prompts for user input.

I think I just have to run test.pl twice -- once to detect the failure and once to capture the output.  I figured out that if there are both t/*.t files and test.pl, I can create a dummy " skipping.t" file on the fly and run "make test TEST_FILES=skipping.t" that bypasses t/*.t.  While Test::Harness would still run, it will give a messages that indicate that those tests are being skipped to run test.pl by itself.

<Sigh>

Oh, backwards compatibility is such a joy.  (Andreas, I have great sympathy for you.)

Regards,
David

Reply via email to