David Cantrell wrote:
> Michael G Schwern wrote:
>
>> First thing is breaks, and probably most important:  No warnings.
>
> Any test suite that blithely ignores warnings is BROKEN.
>
> There are two types of warning.  First, those which you deliberately
> spit out, like "use of foo() is deprecated, please use bar() instead".
> Your tests need to exercise that warning, so need to somehow capture
> them and check that they're spat out at the right time.  If you don't do
> that, you're not testing properly.
>
> The second type of warning is the one that tells you when you the author
> have fucked up, like, when you say "my $variable" twice, or saying
> "$variable = 'one thing'" and "$varable = 'something else'".  I deal
> with those by having $SIG{__WARN__} turn them into die()s in the tests.
>   If you don't deal with them, you're saying that you don't care about
> tripping yourself up in the future.

I have to disagree here.  You are saying that it is the test's
responsibility to fail if it issues any warnings.  I believe
an author may choose to scan the test output and rely on seeing
messages to go to stderr.  Obviously it's better to do as you
propose, but that takes extra work in every test to implement.
Authors should not be counted on to do so, and when they don't
go that extra mile, their warnings should not just get lost.

Reply via email to