Test::Smoke::Smoker - OO interface to do one smoke cycle.
use Test::Smoke; use Test::Smoke::Smoker; open LOGFILE, "> mktest.out" or die "Cannot create 'mktest.out': $!"; my $buildcfg = Test::SmokeBuildCFG->new( $conf->{cfg} ); my $policy = Test::Smoke::Policy->new( '../', $conf->{v} ); my $smoker = Test::Smoke::Smoker->new( \*LOGFILE, $conf ); foreach my $config ( $buildcfg->configurations ) { $smoker->smoke( $config, $policy ); }
The Test::Smoke::Smoker module, an OO interface to do one smoke cycle.
new() takes a mandatory (opened) filehandle and some other options:
new()
ddir build directory fdir The forest source v verbose level: 0..2 defaultenv 'make test' without $ENV{PERLIO} is56x skip the PerlIO stuff? locale do another testrun with $ENV{LC_ALL} force_c_locale set $ENV{LC_ALL} = 'C' for all smoke runs is_win32 is this MSWin32? w32cc the CCTYPE for MSWin32 (MSVCxx BORLAND GCC) w32make the maker to use for CCTYPE
Get verbosity.
Write the current timestamp with 'Start' marker to the logfile.
Write the current timestamp with 'Stopped' marker to the logfile.
config() is an interface to the package lexical %CONFIG, which holds all the default values for the new() arguments.
config()
%CONFIG
With the special key all_defaults this returns a reference to a hash holding all the default values.
Prints a message to the default filehandle.
Prints a message to the logfile, filehandle.
Prints a message to both the default and the logfile filehandles.
smoke() takes a Test::Smoke::BuildCFG::Config object and runs all the basic steps as (private) object methods.
smoke()
make_distclean() runs make -i distclean 2>/dev/null
make_distclean()
make -i distclean 2>/dev/null
extra_manicheck() will only work for $self->{v} > 1 and does an extra integrity check comparing MANIFEST and the source-tree. Output is send to the tty.
extra_manicheck()
$self->{v} > 1
handle_policy() will try to apply the substition rules and then write the file Policy.sh.
handle_policy()
Configure() sorts out the MSWin32 mess and calls ./Configure
Configure()
returns true if a makefile was created
make_() will run make.
make_()
returns true if a perl executable is found
Run make test-prep and check if t/perl exists.
make test-prep
Use Test::Harness (the test_harness target) to get the failing test information and do not bother with TEST.
The command to run make test_harness differs based on platform, so the arguments have to be passed into general routine. $target specifies the makefile-target, $makeopt specifies the extra options for the make program.
make test_harness
$target
$makeopt
make was unable to build a perl executable, but managed to build miniperl, so we do make minitest.
make
make minitest
Factor out the parsing of the Test::Harness output, as it seems subject to change.
Fator out the parsing of the Test::Harness 3 output, as it seems subject to change.
_transform_testnames() takes a list of testnames, as found by TEST (testname without .t suffix followed by dots and a reason) and returns a hash with the filenames relative to the t/ directory as keys and the reason as value.
_transform_testnames()
TEST
.t
t/
Normalize a testname...
Read from a MANIFEST like file, set in $self->{skip_tests}, and rename the files in it with the extension .tskip. If $unset is set, they will be renamed back.
$self->{skip_tests}
$unset
Calls $self->set_skip_tests( 1 ).
$self->set_skip_tests( 1 )
_run() returns qx( $command ) unless $sub is specified. If $sub is defined (and a coderef) $sub->( $command, @args ) will be called.
_run()
qx( $command )
$sub
$sub->( $command, @args )
_make() calls run( "make $command" ), and does some extra stuff to help MSWin32 (the right maker, the directory).
_make()
run( "make $command" )
_make_fork() opens a read pipe to the make command with $target and $extra arguments for the make command.
_make_fork()
$extra
This code sets up a rooted logical TSP5SRC and changes the {ddir} to that root.
TSP5SRC
Test::Smoke
(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:
http://www.perl.com/perl/misc/Artistic.html
http://www.gnu.org/copyleft/gpl.html
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.
To install Test::Smoke, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Smoke
CPAN shell
perl -MCPAN -e shell install Test::Smoke
For more information on module installation, please visit the detailed CPAN module installation guide.