"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "t/properties/needs_compiler.t" between
Module-Build-0.4232.tar.gz and Module-Build-0.4234.tar.gz

About: Module-Build - building & installing Perl modules.

needs_compiler.t  (Module-Build-0.4232):needs_compiler.t  (Module-Build-0.4234)
# sample.t -- a sample test file for Module::Build # sample.t -- a sample test file for Module::Build
use strict; use strict;
use lib 't/lib'; use lib 't/lib';
use MBTest; use MBTest;
use DistGen; use DistGen;
plan tests => 19; plan tests => 27;
# Ensure any Module::Build modules are loaded from correct directory # Ensure any Module::Build modules are loaded from correct directory
blib_load('Module::Build'); blib_load('Module::Build');
my $dist = DistGen->new->regen->chdir_in; my $dist = DistGen->new->regen->chdir_in;
# get a Module::Build object and test with it # get a Module::Build object and test with it
my $mb; my $mb;
stderr_of(sub { stderr_of(sub {
ok( $mb = $dist->new_from_context, "Default Build.PL" ); ok( $mb = $dist->new_from_context, "Default Build.PL" );
}); });
ok( ! $mb->needs_compiler, "needs_compiler is false" ); ok( ! $mb->needs_compiler, "needs_compiler is false" );
ok( ! exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'}, ok( ! exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
"ExtUtils::CBuilder is not in build_requires" "ExtUtils::CBuilder is not in build_requires"
); );
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
# try with c_source # try with c_source as a string
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
$dist->change_build_pl({ $dist->change_build_pl({
module_name => $dist->name, module_name => $dist->name,
license => 'perl', license => 'perl',
c_source => 'src', c_source => 'src',
}); });
$dist->regen; $dist->regen;
stderr_of(sub { stderr_of(sub {
ok( $mb = $dist->new_from_context, ok( $mb = $dist->new_from_context,
"Build.PL with c_source" "Build.PL with string c_source"
); );
}); });
is( $mb->c_source, 'src', "c_source is set" ); is( $mb->c_source, 'src', "c_source is set" );
ok( $mb->needs_compiler, "needs_compiler is true" ); ok( $mb->needs_compiler, "needs_compiler is true" );
ok( exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'}, ok( exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
"ExtUtils::CBuilder was added to build_requires" "ExtUtils::CBuilder was added to build_requires"
); );
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
# try with c_source as an array
#--------------------------------------------------------------------------#
$dist->change_build_pl({
module_name => $dist->name,
license => 'perl',
c_source => ['src'],
});
$dist->regen;
stderr_of(sub {
ok( $mb = $dist->new_from_context,
"Build.PL with non-empty array c_source"
);
});
is_deeply( $mb->c_source, ['src'], "c_source is set" );
ok( $mb->needs_compiler, "needs_compiler is true" );
ok( exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
"ExtUtils::CBuilder was added to build_requires"
);
#--------------------------------------------------------------------------#
# try with c_source as an empty array
#--------------------------------------------------------------------------#
$dist->change_build_pl({
module_name => $dist->name,
license => 'perl',
c_source => [],
});
$dist->regen;
stderr_of(sub {
ok( $mb = $dist->new_from_context,
"Build.PL with empty array c_source"
);
});
is_deeply( $mb->c_source, [], "c_source is set" );
ok( ! $mb->needs_compiler, "needs_compiler is false" );
ok( ! exists $mb->{properties}{build_requires}{'ExtUtils::CBuilder'},
"ExtUtils::CBuilder is not in build_requires"
);
#--------------------------------------------------------------------------#
# try with xs files # try with xs files
#--------------------------------------------------------------------------# #--------------------------------------------------------------------------#
$dist = DistGen->new(dir => 'MBTest', xs => 1); $dist = DistGen->new(dir => 'MBTest', xs => 1);
$dist->regen; $dist->regen;
$dist->chdir_in; $dist->chdir_in;
stderr_of(sub { stderr_of(sub {
ok( $mb = $dist->new_from_context, ok( $mb = $dist->new_from_context,
"Build.PL with xs files" "Build.PL with xs files"
); );
 End of changes. 4 change blocks. 
3 lines changed or deleted 43 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)