
Test::Smoke::BuildCFG - OO interface for handling build configurations

use Test::Smoke::BuildCFG;
my $name = 'perlcurrent.cfg';
my $bcfg = Test::Smoke::BuildCFG->new( $name );
foreach my $config ( $bcfg->configurations ) {
# do somthing with $config
}

Handle the build configurations

[ Constructor | Public ]
Initialise a new object.
[Constructor | public]
Initialize a new object without the configurations that have already been fully processed. If *all* configurations have been processed, just pass the equivalent of the new() method.
[ Accessor | Public ]
config() is an interface to the package lexical %CONFIG, which holds all the default values for the new() arguments.
With the special key all_defaults this returns a reference to a hash holding all the default values.
read_parse() reads the build configurations file and parses it.
_read() is a private method that handles the reading.
_parse() will split the build configurations file in sections. Sections are ended with a line that begins with an equals-sign ('=').
There are two types of section
A policy-section contains a "target-option". This is a build option that should be in the ccflags variable in the Policy.sh file (see also Test::Smoke::Policy) and starts with a (forward) slash ('/').
A policy-section can have only one (1) target-option.
_serialize() creates a list of Test::Smoke::BuildCFG::Config objects from the parsed sections.
Recursive sub, mainly taken from the old run_tests() in mktest.pl
Returns the list of configurations (Test::Smoke::BuildCFG::Config objects)
Returns a list of policytargets from the policy substitution sections
Return the parsed configuration as a string.
Parse the logfile and return a hash(ref) of already processed configurations.
This is a constant that returns a textversion of the default configuration.
A wrapper around Test::Smoke::BuildCFG::Config->new() so the object is accessible from outside this package.

Test::Smoke::BuildCFG::Config - OO interface for a build confiuration

my $bcfg = Test::Smoke::BuildCFG::Config->new( $args, $policy );
or
my $bcfg = Test::Smoke::BuildCFG::Config->new;
$bcfg->args( $args );
$bcfg->policy( [ -DDEBUGGING => '-DDEBUGGING' ],
[ -DPERL_COPY_ON_WRITE => '' ] );
if ( $bcfg->has_arg( '-Duseithreads' ) ) {
# do stuff for -Duseithreads
}

This is a simple object that holds both the build arguments and the policy substitutions. The build arguments are stored as a string and the policy subtitutions are stored as a list of lists. Each substitution is represented as a list with the two elements: the target and its substitute.

Create the new object as an anonymous list.
Accessor for the build arguments field.
Accessor for the policy substitutions.
Create a hash with all the build arguments as keys.
Check the build arguments hash for $arg. If you specify more then one the results will be logically ANDed!
Check the build arguments hash for $arg. If you specify more then one the results will be logically ORed!
args_eq() takes a string of config arguments and returns true if $self has exactly the same args as the $args has.
There is the small matter of default_args (dfopts) kept as a Class variable in Test::Smoke::BuildCFG!
Simply remove the argument(s) from the list and recreate the arguments line.
Redo the the commandline switches in a VMSish way.

Test::Smoke::Smoker, Test::Smoke::Syncer::Policy

(c) 2002-2003, All rights reserved.
* Abe Timmerman <abeltje@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.