I was just cleaning up old mails when I found this thread....

On Tue, Jun 10, 2008 at 2:49 PM, David Golden <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 10, 2008 at 12:28 AM, Gabor Szabo <[EMAIL PROTECTED]> wrote:
>> The issue I am trying to solve is how to catch and report
>> when a test suit gives any warnings?
>
> Are there situations where a test suite should give warnings?  I.e.
> stuff that the user should see that shouldn't get swallowed by the
> harness running in a quiet (not verbose) mode?
>
> For example, I have some tests in CPAN::Reporter that test timing out
> a command.  Since that could look like a test has hung (to an
> impatient tester) I make a point to use warn to flag to the user that
> the test is sleeping for a timeout test.
>
> Looks like this:
>
> $ Build test --test_files=t/13_record_command.t
> t/13_record_command......18/37 # sleeping for timeout test
> t/13_record_command......22/37 # sleeping for timeout test
> t/13_record_command......26/37 # sleeping for timeout test
> t/13_record_command......ok
> All tests successful.
> Files=1, Tests=37, 19 wallclock secs ( 0.01 usr  0.01 sys +  6.51 cusr
>  2.06 csys =  8.59 CPU)
>
> So is there a better way to do this than warn?

Sure. IMHO that is what *diag* is for.
To print all kinds of messages to the screen in a TAP.

> That said, if you try this at home (with Proc::ProcessTable), you'll
> also get a lovely warning from Proc::ProcessTable having a
> non-portable v-string.  That is a warning that should perhaps be
> fixed, though it turns out to be upstream.  Should I clutter my code
> with stuff to suppress it?  Maybe.
>
> But I don't see how I can have the one without the other.

I think that warning should be reported.
If the tester can (automatically) understand where the warning
comes, it should try to report there. If it cannot then it should
report to you.
I know it is not "optimal" but then you should complain to the
author of the module you used preferably with a test case that
catches the warnings.


The tester should only report about stuff that it sees which is not in
TAP.

Gabor

Reply via email to