Apache::TestRun(3)
π Apache::TestRun β Run the test suite π
Okay bestie, welcome to Apache::TestRun(3) from User Contributed Perl Documentation. This package is literally the main character for controlling the configuration and running of the test suite. No cap. π«Ά
β¨ NAME β¨
Apache::TestRun β Run the test suite. Short, iconic, does exactly what it says on the tin. π
β¨ SYNOPSIS β¨
(Empty. Yes, bestie, there is no synopsis text here β not a single line. The vibes are mysterious. π¦)
πΈ DESCRIPTION πΈ
The Apache::TestRun package controls the configuration and running of the test suite. Itβs giving test-suite main character energy, fr fr. π
π METHODS π
Several methods are sub-classable, if the default behavior should be changed. So if you wanna customize the vibe, you can. Slay. β¨
π bug_report π
The bug_report() method is executed when t/TEST was executed with the -bugreport option, and make test (or t/TEST) fail. Normally this is a callback which you can use to tell the user how to deal with the problem, e.g. suggesting to read some document or email some details to someone who can take care of it. By default nothing is executed. Literally nothing. Crickets. π¦
The -bugreport option is needed so this feature wonβt become annoying to developers themselves. Itβs automatically added to the run_tests target in Makefile. So if you repeateadly have to test your code, just donβt use make test but run t/TEST directly. Thatβs the whole hack, iykyk. π
Here is an example of a custom t/TEST:
My::TestRun->new->run(@ARGV);
package My::TestRun;
use base 'Apache::TestRun';
sub bug_report {
my $self = shift;
print <<EOI;
+--------------------------------------------------------+
| Please file a bug report: http://perl.apache.org/bugs/ |
+--------------------------------------------------------+
EOI
}
π§ pre_configure π§
The pre_configure() method is executed before the configuration for Apache::Test is generated. So if you need to adjust the setup before httpd.conf and other files are autogenerated, this is the right place to do so. Perfect timing, honestly. π
For example if you donβt want to inherit a LoadModule directive for mod_apreq.so but to make sure that the local version is used, you can sub-class Apache::TestRun and override this method in t/TEST.PL:
package My::TestRun;
use base 'Apache::TestRun';
use Apache::TestConfig;
__PACKAGE__->new->run(@ARGV);
sub pre_configure {
my $self = shift;
# Don't load an installed mod_apreq
Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c');
$self->SUPER::pre_configure();
}
Notice that the extension is .c, and not .so. Important detail, bestie β donβt mix them up. π
Donβt forget to run the super classβ c<pre_configure()> method. (Yes, thatβs literally how itβs written, bestie. π)
π new_test_config π
META: to be completed
Thatβs the whole thing. No notes. Not me staring at it waiting for more. π
Signing off with the footer tea: this page is from perl v5.42.3, dated 2023-10-21. Stay slay, bestie. π
π¦ where this page comes from
- nixos 26.05: mod_perl 2.0.13
- nixpkgs unstable: mod_perl 2.0.13
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms