1Test::Smoke::BuildCFG(3U)ser Contributed Perl DocumentatiToenst::Smoke::BuildCFG(3)
2
3
4
6 Test::Smoke::BuildCFG - OO interface for handling build configurations
7
9 use Test::Smoke::BuildCFG;
10
11 my $name = 'perlcurrent.cfg';
12 my $bcfg = Test::Smoke::BuildCFG->new( $name );
13
14 foreach my $config ( $bcfg->configurations ) {
15 # do somthing with $config
16 }
17
19 Handle the build configurations
20
22 Test::Smoke::BuildCFG->new( [$cfgname] )
23 [ Constructor | Public ]
24
25 Initialise a new object.
26
27 Test::Smoke::BuildCFG->continue( $logfile[, $cfgname, %options] )
28 [Constructor | public]
29
30 Initialize a new object without the configurations that have
31 already been fully processed. If *all* configurations have been
32 processed, just pass the equivalent of the "new()" method.
33
34 Test::Smoke::BuildCFG->config( $key[, $value] )
35 [ Accessor | Public ]
36
37 "config()" is an interface to the package lexical %CONFIG, which
38 holds all the default values for the "new()" arguments.
39
40 With the special key all_defaults this returns a reference to a
41 hash holding all the default values.
42
43 $self->read_parse( $cfgname )
44 "read_parse()" reads the build configurations file and parses it.
45
46 $self->_read( $nameorref )
47 "_read()" is a private method that handles the reading.
48
49 Reference to a SCALAR build configurations are in $$nameorref
50 Reference to an ARRAY build configurations are in @$nameorref
51 Reference to a GLOB build configurations are read from the
52 filehandle
53 Other values are taken as the filename for the build configurations
54 $self->_parse( )
55 "_parse()" will split the build configurations file in sections.
56 Sections are ended with a line that begins with an equals-sign
57 ('=').
58
59 There are two types of section
60
61 buildopt-section
62 policy-section
63 A policy-section contains a "target-option". This is a
64 build option that should be in the ccflags variable in the
65 Policy.sh file (see also Test::Smoke::Policy) and starts
66 with a (forward) slash ('/').
67
68 A policy-section can have only one (1) target-option.
69
70 $self->_serialize( )
71 "_serialize()" creates a list of Test::Smoke::BuildCFG::Config
72 objects from the parsed sections.
73
74 __build_list( $list, $previous_args, $policy_subst, $this_cfg, @cfgs )
75 Recursive sub, mainly taken from the old "run_tests()" in mktest.pl
76
77 $buildcfg->configurations( )
78 Returns the list of configurations (Test::Smoke::BuildCFG::Config
79 objects)
80
81 $buildcfg->policy_targets( )
82 Returns a list of policytargets from the policy substitution
83 sections
84
85 as_string
86 Return the parsed configuration as a string.
87
88 __get_smoked_configs( $logfile )
89 Parse the logfile and return a hash(ref) of already processed
90 configurations.
91
92 Test::Smoke::BuildCFG->default_buildcfg()
93 This is a constant that returns a textversion of the default
94 configuration.
95
96 new_configuration( $config )
97 A wrapper around "Test::Smoke::BuildCFG::Config->new()" so the
98 object is accessible from outside this package.
99
101 Test::Smoke::BuildCFG::Config - OO interface for a build confiuration
102
104 my $bcfg = Test::Smoke::BuildCFG::Config->new( $args, $policy );
105
106 or
107
108 my $bcfg = Test::Smoke::BuildCFG::Config->new;
109 $bcfg->args( $args );
110 $bcfg->policy( [ -DDEBUGGING => '-DDEBUGGING' ],
111 [ -DPERL_COPY_ON_WRITE => '' ] );
112
113 if ( $bcfg->has_arg( '-Duseithreads' ) ) {
114 # do stuff for -Duseithreads
115 }
116
118 This is a simple object that holds both the build arguments and the
119 policy substitutions. The build arguments are stored as a string and
120 the policy subtitutions are stored as a list of lists. Each
121 substitution is represented as a list with the two elements: the target
122 and its substitute.
123
125 Test::Smoke::BuildCFG::Config->new( [ $args[, \@policy_substs ]] )
126 Create the new object as an anonymous list.
127
128 $buildcfg->args( [$args] )
129 Accessor for the build arguments field.
130
131 $buildcfg->policy( [@substitutes] )
132 Accessor for the policy substitutions.
133
134 $self->_split_args( )
135 Create a hash with all the build arguments as keys.
136
137 $buildcfg->has_arg( $arg[,...] )
138 Check the build arguments hash for $arg. If you specify more then
139 one the results will be logically ANDed!
140
141 $buildcfg->any_arg( $arg[,...] )
142 Check the build arguments hash for $arg. If you specify more then
143 one the results will be logically ORed!
144
145 $buildcfg->args_eq( $args )
146 "args_eq()" takes a string of config arguments and returns true if
147 $self has exactly the same args as the $args has.
148
149 There is the small matter of default_args (dfopts) kept as a Class
150 variable in Test::Smoke::BuildCFG!
151
152 rm_arg( $arg[,..] )
153 Simply remove the argument(s) from the list and recreate the
154 arguments line.
155
156 $config->vms
157 Redo the the commandline switches in a VMSish way.
158
160 Test::Smoke::Smoker, Test::Smoke::Syncer::Policy
161
163 (c) 2002-2003, All rights reserved.
164
165 * Abe Timmerman <abeltje@cpan.org>
166
167 This library is free software; you can redistribute it and/or modify it
168 under the same terms as Perl itself.
169
170 See:
171
172 · http://www.perl.com/perl/misc/Artistic.html
173
174 · http://www.gnu.org/copyleft/gpl.html
175
176 This program is distributed in the hope that it will be useful, but
177 WITHOUT ANY WARRANTY; without even the implied warranty of
178 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
179
180
181
182perl v5.12.1 2008-07-19 Test::Smoke::BuildCFG(3)