1Apache::TestRun(3) User Contributed Perl Documentation Apache::TestRun(3)
2
3
4
6 Apache::TestRun - Run the test suite
7
10 The "Apache::TestRun" package controls the configuration and running of
11 the test suite.
12
14 Several methods are sub-classable, if the default behavior should be
15 changed.
16
17 "bug_report"
18 The "bug_report()" method is executed when "t/TEST" was executed with
19 the "-bugreport" option, and "make test" (or "t/TEST") fail. Normally
20 this is callback which you can use to tell the user how to deal with
21 the problem, e.g. suggesting to read some document or email some
22 details to someone who can take care of it. By default nothing is
23 executed.
24
25 The "-bugreport" option is needed so this feature won't become annoying
26 to developers themselves. It's automatically added to the "run_tests"
27 target in Makefile. So if you repeateadly have to test your code, just
28 don't use "make test" but run "t/TEST" directly. Here is an example of
29 a custom "t/TEST"
30
31 My::TestRun->new->run(@ARGV);
32
33 package My::TestRun;
34 use base 'Apache::TestRun';
35
36 sub bug_report {
37 my $self = shift;
38
39 print <<EOI;
40 +--------------------------------------------------------+
41 | Please file a bug report: http://perl.apache.org/bugs/ |
42 +--------------------------------------------------------+
43 EOI
44 }
45
46 "pre_configure"
47 The "pre_configure()" method is executed before the configuration for
48 "Apache::Test" is generated. So if you need to adjust the setup before
49 httpd.conf and other files are autogenerated, this is the right place
50 to do so.
51
52 For example if you don't want to inherit a LoadModule directive for
53 mod_apreq.so but to make sure that the local version is used, you can
54 sub-class "Apache::TestRun" and override this method in t/TEST.PL:
55
56 package My::TestRun;
57 use base 'Apache::TestRun';
58 use Apache::TestConfig;
59 __PACKAGE__->new->run(@ARGV);
60
61 sub pre_configure {
62 my $self = shift;
63 # Don't load an installed mod_apreq
64 Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c');
65
66 $self->SUPER::pre_configure();
67 }
68
69 Notice that the extension is .c, and not .so.
70
71 Don't forget to run the super class' c<pre_configure()> method.
72
73 "new_test_config"
74 META: to be completed
75
76
77
78perl v5.32.0 2020-07-28 Apache::TestRun(3)