X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fbootstrap.t;fp=xt%2Fbootstrap.t;h=d50b992931d932aa67b4ea8d821fced8cde05e75;hb=18f3e0b50ca6b0d5235e375fa59da1f8c5a263db;hp=54a1e5919bcf8a09eb7e75fa886f9d588f5f1733;hpb=3f7d1689c55252ffda33bbaedc930b884060d3df;p=p5sagit%2Flocal-lib.git diff --git a/xt/bootstrap.t b/xt/bootstrap.t index 54a1e59..d50b992 100755 --- a/xt/bootstrap.t +++ b/xt/bootstrap.t @@ -14,6 +14,11 @@ BEGIN { } use Test::More; +BEGIN { + if (!eval {require Capture::Tiny}) { + plan skip_all => 'Capture::Tiny required to test bootstrapping'; + } +} use File::Temp; use File::Spec; use local::lib (); @@ -45,15 +50,20 @@ plan tests => 1+@modules; for my $module (@modules) { my $version = check_version($module->[0]); if ($version && $version >= $module->[1]) { - warn "Can't test bootstrap of $module->[0], version $version already meets requirement of $module->[1]\n"; + diag "Can't test bootstrap of $module->[0], version $version already meets requirement of $module->[1]"; } } $ENV{HOME} = my $home = File::Temp::tempdir( CLEANUP => 1 ); -local::lib->import; +mkdir my $ll = File::Spec->catdir($home, 'perl5'); +local::lib->import($ll); -system($^X, 'Makefile.PL', '--bootstrap'); -is $?, 0, 'Makefile.PL ran successfully'; +my $result; +my $out = Capture::Tiny::capture_merged { + $result = system($^X, 'Makefile.PL', '--bootstrap'); +}; +is $result, 0, 'Makefile.PL ran successfully' + or diag $out; for my $module (@modules) { my $version = check_version($module->[0]);