Test::NoWarnings

Test::NoWarnings is a Perl module to make sure you didn't emit any warnings while testing.
Download

Test::NoWarnings Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Fergal Daly
  • Publisher web site:
  • http://search.cpan.org/~fdaly/Test-NoWarnings-0.084/lib/Test/NoWarnings.pm

Test::NoWarnings Tags


Test::NoWarnings Description

Test::NoWarnings is a Perl module to make sure you didn't emit any warnings while testing. Test::NoWarnings is a Perl module to make sure you didn't emit any warnings while testing.SYNOPSISFor scripts that have no plan use Test::NoWarnings;that's it, you don't need to do anything elseFor scripts that look like use Test::More tests => x;change to use Test::More tests => x + 1; use Test::NoWarnings;In general, your tests shouldn't produce warnings. This modules causes any warnings to be captured and stored. It automatically adds an extra test that will run when your script ends to check that there were no warnings. If there were any warings, the test will give a "not ok" and diagnostics of where, when and what the warning was, including a stack trace of what was going on when the it occurred.If some of your tests are supposed to produce warnings then you should be capturing and checking them with Test::Warn, that way Test::NoWarnings will not see them and so not complain.The test is run by an END block in Test::NoWarnings. It will not be run when any forked children exit.USAGESimply by using the module, you automatically get an extra test at the end of your script that checks that no warnings were emitted. So just stick use Test::NoWarningsat the top of your script and continue as normal.If you want more control you can invoke the test manually at any time with had_no_warnings().The warnings your test has generated so far are stored in an array. You can look inside and clear this whenever you want with warnings() and clear_warnings(), however, if you are doing this sort of thing then you probably want to use Test::Warn in combination with Test::NoWarnings.Requirements:· Perl Requirements: · Perl


Test::NoWarnings Related Software