1Apache::TestConfig(3) User Contributed Perl DocumentationApache::TestConfig(3)
2
3
4
6 Apache::TestConfigData - Configuration file for Apache::Test
7
9 Apache::TestConfig -- Test Configuration setup module
10
12 use Apache::TestConfig;
13
14 my $cfg = Apache::TestConfig->new(%args)
15 my $fh = $cfg->genfile($file);
16 $cfg->writefile($file, $content);
17 $cfg->gendir($dir);
18 ...
19
21 "Apache::TestConfig" is used in creating the "Apache::Test"
22 configuration files.
23
25 genwarning()
26 my $warn = $cfg->genwarning($filename)
27
28 genwarning() returns a warning string as a comment, saying that the
29 file was autogenerated and that it's not a good idea to modify this
30 file. After the warning a perl trace of calls to this this function
31 is appended. This trace is useful for finding what code has created
32 the file.
33
34 my $warn = $cfg->genwarning($filename, $from_filename)
35
36 If $from_filename is specified it'll be used in the warning to tell
37 which file it was generated from.
38
39 genwarning() automatically recognizes the comment type based on the
40 file extension. If the extension is not recognized, the default "#"
41 style is used.
42
43 Currently it support "<!-- -->", "/* ... */" and "#" styles.
44
45 genfile()
46 my $fh = $cfg->genfile($file);
47
48 genfile() creates a new file $file for writing and returns a file
49 handle.
50
51 If parent directories of $file don't exist they will be
52 automagically created.
53
54 The file $file and any created parent directories (if found empty)
55 will be automatically removed on cleanup.
56
57 A comment with a warning and calls trace is added to the top of
58 this file. See genwarning() for more info about this comment.
59
60 my $fh = $cfg->genfile($file, $from_file);
61
62 If $from_filename is specified it'll be used in the warning to tell
63 which file it was generated from.
64
65 my $fh = $cfg->genfile($file, $from_file, $nowarning);
66
67 If $nowarning is true, the warning won't be added. If using this
68 optional argument and there is no $from_file you must pass undef as
69 in:
70
71 my $fh = $cfg->genfile($file, undef, $nowarning);
72
73 writefile()
74 $cfg->writefile($file, $content, [$nowarning]);
75
76 writefile() creates a new file $file with the content of $content.
77
78 A comment with a warning and calls trace is added to the top of
79 this file unless $nowarnings is passed and set to a true value. See
80 genwarning() for more info about this comment.
81
82 If parent directories of $file don't exist they will be
83 automagically created.
84
85 The file $file and any created parent directories (if found empty)
86 will be automatically removed on cleanup.
87
88 write_perlscript()
89 $cfg->write_perlscript($filename, @lines);
90
91 Similar to writefile() but creates an executable Perl script with
92 correctly set shebang line.
93
94 gendir()
95 $cfg->gendir($dir);
96
97 gendir() creates a new directory $dir.
98
99 If parent directories of $dir don't exist they will be
100 automagically created.
101
102 The directory $dir and any created parent directories will be
103 automatically removed on cleanup if found empty.
104
106 The following environment variables affect the configuration and the
107 run-time of the "Apache::Test" framework:
108
109 APACHE_TEST_COLOR
110 To aid visual control over the configuration process and the run-time
111 phase, "Apache::Test" uses coloured fonts when the environment variable
112 "APACHE_TEST_COLOR" is set to a true value.
113
114 APACHE_TEST_LIVE_DEV
115 When using "Apache::Test" during the project development phase, it's
116 often convenient to have the project/lib (live) directory appearing
117 first in @INC so any changes to the Perl modules, residing in it,
118 immediately affect the server, without a need to rerun "make" to update
119 blib/lib. When the environment variable "APACHE_TEST_LIVE_DEV" is set
120 to a true value during the configuration phase ("t/TEST -config",
121 "Apache::Test" will automatically unshift the project/lib directory
122 into @INC, via the autogenerated t/conf/modperl_inc.pl file.
123
124 APACHE_TEST_INTERACTIVE_PROMPT_OK
125 Normally interactive prompts aren't run when STDIN is not attached to a
126 tty. But sometimes there is a program that can answer the prompts (e.g.
127 when testing A-T itself). If this variable is true the interactive
128 config won't be skipped (if needed).
129
131 When generating configuration files from the *.in templates, special
132 placeholder variables get substituted. To embed a placeholder use the
133 "@foo@" syntax. For example in extra.conf.in you can write:
134
135 Include @ServerRoot@/conf/myconfig.conf
136
137 When extra.conf is generated, "@ServerRoot@" will get replaced with the
138 location of the server root.
139
140 Placeholders are case-insensitive.
141
142 Available placeholders:
143
144 Configuration Options
145 All configuration variables that can be passed to "t/TEST", such as
146 "MaxClients", "DocumentRoot", "ServerRoot", etc. To see the complete
147 list run:
148
149 % t/TEST --help
150
151 and you will find them in the "configuration options" sections.
152
153 NextAvailablePort
154 Every time this placeholder is encountered it'll be replaced with the
155 next available port. This is very useful if you need to allocate a
156 special port, but not hardcode it. Later when running:
157
158 % t/TEST -port=select
159
160 it's possible to run several concurrent test suites on the same
161 machine, w/o having port collisions.
162
165 perl(1), Apache::Test(3)
166
167
168
169perl v5.10.1 2007-12-31 Apache::TestConfig(3)