1Test::Compile::InternalU(s3e)r Contributed Perl DocumentaTteisotn::Compile::Internal(3)
2
3
4
6 Test::Compile::Internal - Assert that your Perl files compile OK.
7
9 use Test::Compile::Internal;
10 my $test = Test::Compile::Internal->new();
11 $test->all_files_ok();
12 $test->done_testing();
13
15 "Test::Compile::Internal" is an object oriented tool for testing
16 whether your perl files compile.
17
18 It is primarily to provide the inner workings of "Test::Compile", but
19 it can also be used directly to test a CPAN distribution.
20
22 new()
23 A basic constructor, nothing special.
24
25 all_files_ok(@dirs)
26 Looks for perl files and tests them all for compilation errors.
27
28 If @dirs is defined then it is taken as an array of files or
29 directories to be searched for perl files, otherwise it searches
30 the default locations you'd expect to find perl files in a perl
31 module - see "all_pm_files(@dirs)" and "all_pl_files(@dirs)" for
32 details.
33
34 all_pm_files_ok(@dirs)
35 Checks all the perl module files it can find for compilation
36 errors.
37
38 If @dirs is defined then it is taken as an array of files or
39 directories to be searched for perl files, otherwise it searches
40 some default locations - see "all_pm_files(@dirs)".
41
42 all_pl_files_ok(@dirs)
43 Checks all the perl program files it can find for compilation
44 errors.
45
46 If @dirs is defined then it is taken as an array of directories to
47 be searched for perl files, otherwise it searches some default
48 locations - see "all_pl_files(@dirs)".
49
50 verbose($verbose)
51 An accessor to get/set the verbosity. The default value (undef)
52 will suppress output unless the compilation fails. This is
53 probably what you want.
54
55 If "verbose" is set to true, you'll get the output from 'perl -c'.
56 If it's set to false, all diagnostic output is suppressed.
57
58 all_pm_files(@dirs)
59 Searches for and returns a list of perl module files - that is,
60 files with a .pm extension.
61
62 If you provide a list of @dirs, it'll use that as a list of files
63 to process, or directories to search for perl modules.
64
65 If you don't provide "dirs", it'll search for perl modules in the
66 blib/lib directory, if that directory exists, otherwise it'll
67 search the lib directory.
68
69 Skips any files in CVS, .svn, or .git directories.
70
71 all_pl_files(@dirs)
72 Searches for and returns a list of perl script files - that is, any
73 files that either have a case insensitive .pl, .psgi extension, or
74 have no extension but have a perl shebang line.
75
76 If you provide a list of @dirs, it'll use that as a list of files
77 to process, or directories to search for perl scripts.
78
79 If you don't provide "dirs", it'll search for perl scripts in the
80 blib/script/ and blib/bin/ directories if blib exists, otherwise
81 it'll search the script/ and bin/ directories
82
83 Skips any files in CVS, .svn, or .git directories.
84
85 pl_file_compiles($file)
86 Returns true if $file compiles as a perl script.
87
88 pm_file_compiles($file)
89 Returns true if $file compiles as a perl module.
90
92 "Test::Compile::Internal" encapsulates a "Test::Builder" object, and
93 provides access to some of its methods.
94
95 "ok($test, $name)"
96 Your basic test. Pass if $test is true, fail if $test is false.
97 Just like "Test::Simple"'s ok().
98
99 done_testing()
100 Declares that you got to the end of your test plan, no more tests
101 will be run after this point.
102
103 "plan(tests => $count)"
104 Defines how many tests you plan to run.
105
106 diag(@msgs)
107 Prints out the given @msgs. Like print, arguments are simply
108 appended together.
109
110 Output will be indented and marked with a # so as not to interfere
111 with test output. A newline will be put on the end if there isn't
112 one already.
113
114 We encourage using this rather than calling print directly.
115
116 skip($reason)
117 Skips the current test, reporting the $reason.
118
119 skip_all($reason)
120 Skips all the tests, using the given $reason. Exits immediately
121 with 0.
122
124 Sagar R. Shah "<srshah@cpan.org>", Marcel GrĂ¼nauer,
125 "<marcel@cpan.org>", Evan Giles, "<egiles@cpan.org>"
126
128 Copyright 2007-2023 by the authors.
129
130 This library is free software; you can redistribute it and/or modify it
131 under the same terms as Perl itself.
132
134 Test::Strict provides functions to ensure your perl files compile, with
135 the added bonus that it will check you have used strict in all your
136 files.
137
138 Test::LoadAllModules just handles modules, not script files, but has
139 more fine-grained control.
140
141
142
143perl v5.36.0 2023-04-06 Test::Compile::Internal(3)