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 directory, unless that directory doesn't exist, in which case
67 it'll search the lib directory.
68
69 Skips any files in CVS, .svn, or .git directories.
70
71 The order of the files returned is machine-dependent. If you want
72 them sorted, you'll have to sort them yourself.
73
74 "all_pl_files(@dirs)"
75 Searches for and returns a list of perl script files - that is, any
76 files that either have a case insensitive .pl, .psgi extension, or
77 have no extension but have a perl shebang line.
78
79 If you provide a list of @dirs, it'll use that as a list of files
80 to process, or directories to search for perl scripts.
81
82 If you don't provide "dirs", it'll search for perl scripts in the
83 blib/script/ directory, or if that doesn't exist, the script/
84 directory, or if that doesn't exist, the bin/ directory.
85
86 Skips any files in CVS, .svn, or .git directories.
87
88 The order of the files returned is machine-dependent. If you want
89 them sorted, you'll have to sort them yourself.
90
91 "pl_file_compiles($file)"
92 Returns true if $file compiles as a perl script.
93
94 "pm_file_compiles($file)"
95 Returns true if $file compiles as a perl module.
96
98 "Test::Compile::Internal" encapsulates a "Test::Builder" object, and
99 provides access to some of its methods.
100
101 "done_testing()"
102 Declares that you are done testing, no more tests will be run after
103 this point.
104
105 "ok($test, $name)"
106 Your basic test. Pass if $test is true, fail if $test is false.
107 Just like "Test::Simple"'s "ok()".
108
109 "plan(tests => $count)"
110 Defines how many tests you plan to run.
111
112 "diag(@msgs)"
113 Prints out the given @msgs. Like print, arguments are simply
114 appended together.
115
116 Output will be indented and marked with a # so as not to interfere
117 with test output. A newline will be put on the end if there isn't
118 one already.
119
120 We encourage using this rather than calling print directly.
121
122 "skip($reason)"
123 Skips the current test, reporting the $reason.
124
125 "skip_all($reason)"
126 Skips all the tests, using the given $reason. Exits immediately
127 with 0.
128
130 Sagar R. Shah "<srshah@cpan.org>", Marcel GrĂ¼nauer,
131 "<marcel@cpan.org>", Evan Giles, "<egiles@cpan.org>"
132
134 Copyright 2007-2021 by the authors.
135
136 This library is free software; you can redistribute it and/or modify it
137 under the same terms as Perl itself.
138
140 Test::Strict provides functions to ensure your perl files compile, with
141 the added bonus that it will check you have used strict in all your
142 files.
143
144
145
146perl v5.36.0 2022-07-22 Test::Compile::Internal(3)