1Test::Smoke::Util(3) User Contributed Perl Documentation Test::Smoke::Util(3)
2
3
4
6 Test::Smoke::Util - Take out some of the functions of the smoke suite.
7
9 I've taken out some of the general stuff and put it here. Now I can
10 write some tests!
11
12 Configure_win32( $command[, $win32_maker[, @args]] )
13 "Configure_win32()" alters the settings of the makefile for
14 MSWin32.
15
16 $command is in the form of './Configure -des -Dusedevel ...'
17
18 $win32_maker should either be "nmake" or "dmake", the default is
19 "nmake".
20
21 @args is a list of "option=value" pairs that will (eventually) be
22 passed to Config.pm.
23
24 PLEASE read README.win32 and study the comments in the makefile.
25
26 It supports these options:
27
28 · -Duseperlio
29
30 set USE_PERLIO = define (default) [should be depricated]
31
32 · -Dusethreads
33
34 set USE_ITHREADS = define (also sets USE_MULTI and USE_IMP_SYS)
35
36 · -Duseithreads
37
38 set USE_ITHREADS = define (also sets USE_MULTI and USE_IMP_SYS)
39
40 · -Dusemultiplicity
41
42 sets USE_MULTI = define (also sets USE_ITHREADS and
43 USE_IMP_SYS)
44
45 · -Duseimpsys
46
47 sets USE_IMP_SYS = define (also sets USE_ITHREADS and
48 USE_MULTI)
49
50 · -Dusemymalloc
51
52 set PERL_MALLOC = define
53
54 · -Duselargefiles
55
56 set USE_LARGE_FILES = define
57
58 · -Dbccold
59
60 set BCCOLD = define (this is for bcc32 <= 5.4)
61
62 · -Dgcc_v3_2
63
64 set USE_GCC_V3_2 = define (this is for gcc >= 3.2)
65
66 · -DDEBUGGING
67
68 sets CFG = Debug
69
70 · -DINST_DRV=...
71
72 sets INST_DRV to a new value (default is "c:")
73
74 · -DINST_TOP=...
75
76 sets INST_DRV to a new value (default is "$(INST_DRV)\perl"),
77 this is where perl will be installed when "[nd]make install" is
78 run.
79
80 · -DINST_VER=...
81
82 sets INST_VER to a new value (default is forced not set), this
83 is also used as part of the installation path to get a more
84 unixy installation. Without "INST_VER" and "INST_ARCH" you get
85 an ActiveState like installation.
86
87 · -DINST_ARCH=...
88
89 sets INST_ARCH to a new value (default is forced not set), this
90 is also used as part of the installation path to get a more
91 unixy installation. Without "INST_VER" and "INST_ARCH" you
92 get an ActiveState like installation.
93
94 · -DCCHOME=...
95
96 Set the base directory for the C compiler. $(CCHOME)\bin still
97 needs to be in the path!
98
99 · -DIS_WIN95
100
101 sets IS_WIN95 to 'define' to indicate this is Win9[58]
102
103 · -DCRYPT_SRC=...
104
105 The file to use as source for des_fcrypt()
106
107 · -DCRYPT_LIB=...
108
109 The library to use for des_fcrypt()
110
111 · -Dcf_email=...
112
113 Set the cf_email option (Config.pm)
114
115 · -Accflags=...
116
117 Adds the option to BUILDOPT. This is implemented differently
118 for nmake and dmake. Returns the name of the outputfile.
119
120 set_vms_rooted_logical( $logical, $dir )
121 This will set a VMS rooted logical like:
122
123 define/translation=concealed $logical $dir
124
125 get_cfg_filename( )
126 "get_cfg_filename()" tries to find a cfg file and returns it.
127
128 grepccmsg( $cc, $logfile, $verbose )
129 This is a port of Jarkko Hietaniemi's grepccerr script.
130
131 get_local_patches( $ddir )
132 "get_local_patches()" reads patchlevel.h to scan for the locally
133 applied patches array.
134
135 set_local_patch( $ddir, @descr )
136 Copy the code from patchlevel.h. Older (pre 5.8.1) perls do not
137 have it and it doesn't work on MSWin32.
138
139 get_config( $filename )
140 Read and parse the configuration from file, or return the default
141 config.
142
143 get_patch( [$ddir] )
144 Try to find the patchlevel, look for .patch or try to get it from
145 patchlevel.h as a fallback.
146
147 version_from_patchlevel_h( $ddir )
148 "version_from_patchlevel_h()" returns a "dotted" version as derived
149 from the patchlevel.h file in the distribution.
150
151 get_ncpu( $osname )
152 "get_ncpu()" returns the number of available
153 (online/active/enabled) CPUs.
154
155 It does this by using some operating system specific trick (usually
156 by running some external command and parsing the output).
157
158 If it cannot recognize your operating system an empty string is
159 returned. If it can recognize it but the external command failed,
160 "? cpus" is returned.
161
162 In the first case (where we really have no idea how to proceed),
163 also a warning ("get_ncpu: unknown operating system") is sent to
164 STDERR.
165
166 WARNINGS
167 If you get the warning "get_ncpu: unknown operating system", you
168 will need to help us-- how does one tell the number of available
169 CPUs in your operating system? Sometimes there are several
170 different ways: please try to find the fastest one, and a one that
171 does not require superuser (administrator) rights.
172
173 Thanks to Jarkko Hietaniemi for donating this!
174
175 get_smoked_Config( $dir, @keys )
176 "get_smoked_Config()" returns a hash (a listified hash) with the
177 specified keys. It will try to find lib/Config.pm to get those
178 values, if that cannot be found (make error?) we can try config.sh
179 which is used to build lib/Config.pm. If config.sh is not there
180 (./Configure error?) we try to get some fallback information from
181 "POSIX::uname()" and patchlevel.h.
182
183 parse_report_Config( $report )
184 "parse_report_Config()" returns a list attributes from a smoke
185 report.
186
187 my( $version, $plevel, $os, $osvers, $archname, $summary ) =
188 parse_report_Config( $rpt );
189
190 get_regen_headers( $ddir )
191 "get_regen_headers()" looks in $ddir to find either
192 regen_headers.pl or regen.pl (change 18851).
193
194 Returns undef if not found or a string like "$^X
195 "$regen_headers_pl""
196
197 run_regen_headers( $ddir, $verbose );
198 "run_regen_headers()" gets its executable from
199 "get_regen_headers()" and opens a pipe from it. warn()s on error.
200
201 whereis( $prog )
202 Try to find an executable instance of $prog in $ENV{PATH}.
203
204 Rreturns a full file-path (with extension) to it.
205
206 vms_whereis( $prog )
207 First look in the SYMBOLS to see if $prog is there. Next look in
208 the KFE-table "INSTALL LIST" if it is there. As a last resort we
209 can scan "DCL$PATH" like we do on *nix/Win32
210
211 clean_filename( $fname )
212 "clean_filename()" basically returns a vmsify() type of filename
213 for VMS, and returns an upcase filename for case-ignorant
214 filesystems.
215
216 calc_timeout( $killtime[, $from] )
217 "calc_timeout()" calculates the timeout in seconds. $killtime can
218 be one of two formats:
219
220 +hh:mm This format represents a duration and is the easy format as
221 we only need to translate that to seconds.
222
223 hh:mm This format represents a clock time (localtime). Calculate
224 minutes from midnight for both $killtime and
225 "localtime($from)", and get the difference. If $from is
226 omitted, "time()" is used.
227
228 If $killtime is the actual time, the timeout will be 24
229 hours!
230
231 time_in_hhmm( $diff )
232 Create a string telling elapsed time in days, hours, minutes,
233 seconds from the number of seconds.
234
235 do_pod2man( %pod2usage_options )
236 If Pod::Usage is there then call its "pod2usage()". In the other
237 case, print the general message passed with the "myusage" key.
238
239 skip_config( $config )
240 Returns true if this config should be skipped. $config should be a
241 Test::Smoke::BuildCFG::Config object.
242
243 skip_filter( $line )
244 "skip_filter()" returns true if the filter rules apply to $line.
245
247 (c) 2001-2003, All rights reserved.
248
249 * H. Merijn Brand <h.m.brand@hccnet.nl>
250 * Nicholas Clark <nick@unfortu.net>
251 * Jarkko Hietaniemi <jhi@iki.fi>
252 * Abe Timmerman <abeltje@cpan.org>
253
254 This library is free software; you can redistribute it and/or modify it
255 under the same terms as Perl itself.
256
257 See:
258
259 * <http://www.perl.com/perl/misc/Artistic.html>,
260 * <http://www.gnu.org/copyleft/gpl.html>
261
262 This program is distributed in the hope that it will be useful, but
263 WITHOUT ANY WARRANTY; without even the implied warranty of
264 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
265
266
267
268perl v5.12.1 2009-10-21 Test::Smoke::Util(3)