Test::S...BuildCFG(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

✨ 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 SCALAR build configurations are in $$nameorref
  • Reference to an ARRAY build configurations are in @$nameorref
  • Reference to a GLOB build 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-section
  • policy-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. 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 of default_args (dfopts) kept as a Class variable in Test::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 πŸ’œ


(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