.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::UseAllModules 3pm" .TH Test::UseAllModules 3pm "2022-10-13" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::UseAllModules \- do use_ok() for all the MANIFESTed modules .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& # basic usage \& use strict; \& use Test::UseAllModules; \& \& BEGIN { all_uses_ok(); } \& \& # if you also want to test modules under t/lib \& use strict; \& use Test::UseAllModules under => qw(lib t/lib); \& \& BEGIN { all_uses_ok(); } \& \& # if you have modules that\*(Aqll fail use_ok() for themselves \& use strict; \& use Test::UseAllModules; \& \& BEGIN { \& all_uses_ok except => qw( \& Some::Dependent::Module \& Another::Dependent::Module \& ^Yet::Another::Dependent::.* # you can use regex \& ) \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" I'm sick of writing 00_load.t (or something like that) that'll do \fBuse_ok()\fR for every module I write. I'm sicker of updating 00_load.t when I add another file to the distro. This module reads \s-1MANIFEST\s0 to find modules to be tested and does \fBuse_ok()\fR for each of them. Now all you have to do is update \s-1MANIFEST.\s0 You don't have to modify the test any more (hopefully). .SH "EXPORTED FUNCTION" .IX Header "EXPORTED FUNCTION" .SS "all_uses_ok" .IX Subsection "all_uses_ok" Does Test::More's \fBuse_ok()\fR for every module found in \s-1MANIFEST.\s0 If you have modules you don't want to test, give those modules or some regex rules as the argument. The word 'except' is ignored as shown above. .PP As of 0.11, you can also test modules under arbitrary directories by providing a directory list at the loading time (the word 'under' is ignored as shown above). Modules under the lib directory are always tested. .SH "PROTECTED FUNCTION" .IX Header "PROTECTED FUNCTION" .SS "_get_module_list" .IX Subsection "_get_module_list" Returns module paths to test. This function will not be exported. If you want to use this (see below), you always need to call it by the full qualified name. .SH "NOTES" .IX Header "NOTES" As of 0.03, this module calls \s-1BAIL_OUT\s0 of Test::More if any of the use_ok tests should fail. (Thus the following tests will be ignored. Missing or unloadable modules cause a lot of errors of the same kind.) .PP As of 0.12, you can add extra tests before/after \fBall_uses_ok()\fR if you explicitly declare test plan like this. .PP .Vb 5 \& use strict; \& use warnings; \& use Test::More; \& use Test::UseAllModules; \& use Test::NoWarnings; \& \& plan tests => Test::UseAllModules::_get_module_list() + 1; \& \& all_uses_ok(); \& \& # and extra nowarnings test .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" There're several modules like this on the \s-1CPAN\s0 now. Test::Compile and a bit confusing Test::LoadAllModules try to find modules to test by traversing directories. I'm not a big fan of them as they tend to find temporary or unrelated modules as well, but they may be handier especially if you're too lazy to update \s-1MANIFEST\s0 every time. .SH "AUTHOR" .IX Header "AUTHOR" Kenichi Ishigaki, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2006 by Kenichi Ishigaki .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.