Personal tools
Skip to content. | Skip to navigation
Test::TypeTiny module.
According to the Test::More documentation, it is recommended to run use_ok() inside a BEGIN block, so functions are exported at compile-time and prototypes are properly honored. However, people often either forget to add "BEGIN", or mistakenly group "use_ok" with other tests in a single "BEGIN" block, which can create subtle differences in execution order. With this module, simply change all "use_ok" in test scripts to "use ok", and they will be executed at "BEGIN" time. The explicit space after "use" makes it clear that this is a single compile-time action.
The Test::Valgrind::* API lets you run Perl code through the memcheck tool of the valgrind memory debugger, to test for memory errors and leaks. The Test::Valgrind module itself is a front-end to this API. If they aren't available yet, it will first generate suppressions for the current perl interpreter and store them in the portable flavor of ~/.perl/Test-Valgrind/suppressions/$VERSION. The actual run will then take place, and tests will be passed or failed according to the result of the analysis. The complete API is much more versatile than this. By declaring an appropriate Test::Valgrind::Command class, you can run any executable (that is, not only Perl scripts) under valgrind, generate the corresponding suppressions on-the-fly and convert the analysis result to TAP output so that it can be incorporated into your project's test suite. If you're not interested in producing TAP, you can output the results in whatever format you like (for example HTML pages) by defining your own Test::Valgrind::Action class.
Test::Vars finds unused variables in order to keep the source code tidy.
This module's goal is to be a one stop shop for checking to see that your versions across your dist are sane.
This module provides a few convenience methods for testing warning based code.
If you've ever tried to use Test::NoWarnings to confirm there are no warnings generated by your tests, combined with the convenience of done_testing to not have to declare a test count, you'll have discovered that these two features do not play well together, as the test count will be calculated before the warnings test is run, resulting in a TAP error (see examples/test_nowarnings.pl in this distribution for a demonstration). This module is intended to be used as a drop-in replacement for Test::NoWarnings: it also adds an extra test, but runs this test before done_testing calculates the test count, rather than after. It does this by hooking into done_testing as well as via an END block. You can declare a plan, or not, and things will still Just Work. It is actually equivalent to: use Test::NoWarnings 1.04 ':early'; as warnings are still printed normally as they occur. You are safe, and enthusiastically encouraged, to perform a global search-replace of the above with use Test::Warnings; whether or not your tests have a plan.
This module allows you to deliberately hide modules from a program even though they are installed. This is mostly useful for testing modules that have a fallback when a certain dependency module is not installed.