Test::S...BuildCFG(3)
β¨ Test::Smoke::BuildCFG β¨
okay bestie, welcome to the User Contributed Perl Documentation, section 3 π β this is the page for Test::Smoke::BuildCFG, your little OO bestie for handling build configurations. Buckle up, we're doing config files and it's gonna be cute. π
πΈ NAME πΈ
Test::Smoke::BuildCFG β OO interface for handling build configurations. periodt. π
π¦ SYNOPSIS π¦
use Test::Smoke::BuildCFG;
my $name = 'perlcurrent.cfg';
my $bcfg = Test::Smoke::BuildCFG->new( $name );
foreach my $config ( $bcfg->configurations ) {
# do somthing with $config
}
π DESCRIPTION π
It handles the build configurations. That's the whole vibe. It's giving "load the file, parse the file, hand you back pretty objects". π«Ά
π METHODS π
β Test::Smoke::BuildCFG->new( [$cfgname] )
[ Constructor | Public ]
Initialise a brand new object. Fresh start, main character energy. β¨
β Test::Smoke::BuildCFG->continue( $logfile[, $cfgname, %options] )
[Constructor | public]
Initialize a new object, but skip the configurations that have already been fully processed. If all of the configurations have been processed, just do the equivalent of the new() method instead. π§
β $bldcfg->verbose
[ Getter | Public]
Get verbosity. That's it, that's the whole method. π
β Test::Smoke::BuildCFG->config( $key[, $value] )
[ ClassAccessor | Public ]
config() is your 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. lowkey iconic. π
β $self->read_parse( $cfgname )
read_parse() reads the build configurations file and parses it. πΈ
β $self->_read( $nameorref )
_read() is a private method that handles the reading. Here's the tea on what counts as what:
- Reference to a
SCALARbuild configurations are in$$nameorref - Reference to an
ARRAYbuild configurations are in@$nameorref - Reference to a
GLOBbuild configurations are read from the filehandle - Other values are taken as the filename for the build configurations
β $self->_parse( )
_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:
buildopt-sectionpolicy-sectionβ a policy-section contains a "target-option". This is a build option that should be in theccflagsvariable in thePolicy.shfile (see alsoTest::Smoke::Policy) and starts with a (forward) slash ('/').
A policy-section can have only one (1) target-option. Not two. Not zero. ONE. π€
β $self->_serialize( )
_serialize() creates a list of Test::Smoke::BuildCFG::Config objects from the parsed sections. β¨
β __build_list( $list, $previous_args, $policy_subst, $this_cfg, @cfgs )
Recursive sub, mainly taken from the old run_tests() in mktest.pl. π
β $buildcfg->configurations( )
Returns the list of configurations (that's Test::Smoke::BuildCFG::Config objects, bestie). π
β $buildcfg->policy_targets( )
Returns a list of policytargets from the policy substitution sections. π―
β as_string
Return the parsed configuration as a string. π
β source
returns the text-source of this instance. π
β sections
returns an ARRAYREF of the sections in this instance. π
β __get_smoked_configs( $logfile )
Parse the logfile and return a hash(ref) of already processed configurations. π₯
β Test::Smoke::BuildCFG->default_buildcfg()
This is a constant that returns a textversion of the default configuration. β¨
β Test::Smoke::BuildCFG->os_default_buildcfg($os)
Check for "MSWin32" or "VMS" and return one of the three prepared configs. π₯οΈ
β new_configuration( $config )
A wrapper around Test::Smoke::BuildCFG::Config->new() so the object is accessible from outside this package. π«Ά
π PACKAGE π
Test::Smoke::BuildCFG::Config β OO interface for a build confiuration π
πΈ SYNOPSIS πΈ
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
}
π¦ DESCRIPTION π¦
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. π
β METHODS β
π Test::Smoke::BuildCFG::Config->new( [ $args[, \@policy_substs ]] )
Create the new object as an anonymous list. β¨
π $buildcfg->args( [$args] )
Accessor for the build arguments field. π
π $buildcfg->policy( [@substitutes] )
Accessor for the policy substitutions. π
π $self->_split_args( )
Create a hash with all the build arguments as keys. π
π $buildcfg->has_arg( $arg[,...] )
Check the build arguments hash for $arg. If you specify more then one the results will be logically ANDed! π€
π $buildcfg->any_arg( $arg[,...] )
Check the build arguments hash for $arg. If you specify more then one the results will be logically ORed! π«Ά
π $buildcfg->args_eq( $args )
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 ofdefault_args(dfopts) kept as a Class variable inTest::Smoke::BuildCFG! Don't forget it, bestie. π
π $config->rm_arg( $arg[,..] )
Simply remove the argument(s) from the list and recreate the arguments line. π§Ή
π $config->vms
Redo the the commandline switches in a VMSish way. π₯οΈ
π₯ SEE ALSO π₯
Test::Smoke::Smoker, Test::Smoke::Syncer::Policy π
π COPYRIGHT π
(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. fr fr, that's the deal. π
and that's the whole page, bestie!! π This one was generated by perl v5.42.0 and dated 2025-07-25 β yes it's literally called Test::S...BuildCFG(3) in the header, they really said "abbreviate the title, nobody will notice". slay. π
β¨π¦
π¦ where this page comes from
- fedora 43: perl-Test-Smoke 1.84-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms