forked from hdp/module-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/Module/Build/Compat.pm - deal with Build.PL doing exit() with pas…
…sthrough t/lib/DistGen.pm - added a get_file() method t/compat/exit.t - cover the case of exit(0) MANIFEST - regen Changes - update git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@12419 50811bd7-b8ce-0310-adc1-d9db26280581
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
|
||
use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib'; | ||
use MBTest tests => 5; | ||
|
||
use_ok 'Module::Build'; | ||
ensure_blib('Module::Build'); | ||
|
||
######################### | ||
|
||
my $tmp = MBTest->tmpdir; | ||
|
||
# Create test distribution; set requires and build_requires | ||
use DistGen; | ||
my $dist = DistGen->new( dir => $tmp ); | ||
|
||
$dist->regen; | ||
|
||
$dist->chdir_in; | ||
|
||
######################### | ||
|
||
my $mb; stdout_of(sub{ $mb = Module::Build->new_from_context}); | ||
|
||
use Module::Build::Compat; | ||
|
||
$dist->regen; | ||
|
||
Module::Build::Compat->create_makefile_pl('passthrough', $mb); | ||
|
||
# as silly as all of this exit(0) business is, that is what the cpan | ||
# testers have instructed everybody to do so... | ||
$dist->change_file('Build.PL' => | ||
"warn qq(you have no libthbbt\n); exit;\n" . $dist->get_file('Build.PL') | ||
); | ||
|
||
$dist->regen; | ||
|
||
stdout_of(sub{ $mb->ACTION_realclean }); | ||
|
||
my $result; | ||
my ($stdout, $stderr ) = stdout_stderr_of (sub { | ||
$result = $mb->run_perl_script('Makefile.PL'); | ||
}); | ||
ok $result, "Makefile.PL exit"; | ||
like $stdout, qr/running Build\.PL/; | ||
like $stderr, qr/you have no libthbbt$/; | ||
#warn "out: $stdout"; warn "err: $stderr"; | ||
|
||
# vim:ts=2:sw=2:et:sta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters