Test::...nternal(3pm)
π¦ Test::...nternal(3pm) β like, the whole vibe
okay so bestie, welcome to Test::Compile::Internal, straight out of the User Contributed Perl Documentation corner of the internet πΈ this is the page where we make sure your Perl files actually compile, no cap.
β¨ NAME β¨
Test::Compile::Internal β assert that your Perl files compile OK. that's it, that's the whole job π
π SYNOPSIS π
use Test::Compile::Internal;
my $test = Test::Compile::Internal->new();
$test->all_files_ok();
$test->done_testing();
literally three lines and you're off, icon behaviour only π«Ά
π DESCRIPTION π
Test::Compile::Internal is an object oriented tool for testing whether your perl files compile. slay.
its main character job is to be the inner workings of Test::Compile, but ngl it can also be used directly to test a CPAN distribution. so if you wanna go solo with it, that's allowed π
π₯ METHODS π₯
new()
A basic constructor. nothing special, no drama, just vibes β¨
all_files_ok(@search)
Looks for perl files and tests them all for compilation errors.
If @search is defined then it's taken as an array of files or directories to be searched for perl files. otherwise it searches the default locations you'd expect to find perl files in a perl module β peep all_pm_files and all_pl_files for the details π
all_pm_files_ok(@search)
Checks all the perl module files it can find for compilation errors.
If @search is defined then it's taken as an array of files or directories to be searched for perl files. otherwise it searches the default locations you'd expect to find perl files in a perl module β see all_pm_files for details π
all_pl_files_ok(@search)
Checks all the perl program files it can find for compilation errors.
If @search is defined then it's taken as an array of directories to be searched for perl files. otherwise it searches some default locations β see all_pl_files π¦
verbose($verbose)
An accessor to get/set the verbosity.
- the default value (
undef) will suppress output unless the compilation fails. this is probably what you want, fr fr. - if
verboseis set to true, you'll get the output fromperl -c. - if it's set to false, all diagnostic output is suppressed. silence. peaceful. π
all_pm_files(@search)
Searches for and returns a list of perl module files β that is, files with a .pm extension.
- if you provide
@search, it'll use that as a list of files to process, or directories to search for perl modules. - if you don't provide
@search, it'll search for perl modules in theblib/libdirectory (if that directory exists). otherwise it'll search thelibdirectory. - skips any files in
CVS,.svn, or.gitdirectories. we do NOT touch those π
all_pl_files(@search)
Searches for and returns a list of perl script files β that is, any files that either have a case insensitive .pl or .psgi extension, or have no extension but have a perl shebang line π
- if you provide
@search, it'll use that as a list of files to process, or directories to search for perl scripts. - if you don't provide
@search, it'll search for perl scripts in theblib/script/andblib/bin/directories ifblibexists, otherwise it'll search thescript/andbin/directories. - skips any files in
CVS,.svn, or.gitdirectories. same rule, always π
pl_file_compiles($file)
Returns true if $file compiles as a perl script. simple as π
pm_file_compiles($file)
Returns true if $file compiles as a perl module. also simple as π
π TEST METHODS π
Test::Compile::Internal encapsulates a Test::Builder object, and provides access to some of its methods. free real estate, honestly π₯
ok($test, $name)
Your basic test. pass if $test is true, fail if $test is false. just like Test::Simple's ok(). classic, iconic, no notes π
done_testing()
Declares that you got to the end of your test plan β no more tests will be run after this point. the end, periodt π
plan(tests => $count)
Defines how many tests you plan to run. manifesting that exact number β¨
diag(@msgs)
Prints out the given @msgs. like print, arguments are simply appended together.
- output will be indented and marked with a
#so as not to interfere with test output. - a newline will be put on the end if there isn't one already.
we encourage using this rather than calling print directly. do it for the culture π«Ά
skip($reason)
Skips the current test, reporting the $reason. not today, bestie π
skip_all($reason)
Skips all the tests, using the given $reason. exits immediately with 0. like, gone. bye. π
heads up:skip_alldoesn't just skip β it dips out with exit status0right then and there, so nothing after it runs.
πΈ AUTHORS πΈ
Sagar R. Shah <srshah@cpan.org>, Marcel GrΓΌnauer <marcel@cpan.org>, Evan Giles <egiles@cpan.org> β the legends themselves π
β COPYRIGHT AND LICENSE β
Copyright 2007-2023 by the authors.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. generous kings π
π§ SEE ALSO π§
Test::Strictprovides functions to ensure your perl files compile, with the added bonus that it will check you have usedstrictin all your files. overachiever energy, we respect it.Test::LoadAllModulesjust handles modules, not script files, but has more fine-grained control. different vibe, still valid π¦
and that's the page, bestie β written by the authors, shipped with perl v5.42.0, dated 2024-05-06, and lovingly re-explained to you by yours truly. go forth and compile π β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Compile 3.3.3-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms