4 if (@ARGV && $ARGV[0] eq '--check-version') {
6 (my $file = "$module.pm") =~ s{::}{/}g;
9 my $version = do { no strict; ${"${module}::VERSION"} };
18 if (!eval {require Capture::Tiny}) {
19 plan skip_all => 'Capture::Tiny required to test bootstrapping';
26 delete $ENV{PERL5LIB};
27 delete $ENV{PERL_LOCAL_LIB_ROOT};
28 delete $ENV{PERL_MM_OPT};
29 delete $ENV{PERL_MB_OPT};
31 #my @ll_path = File::Spec->splitpath($INC{'local/lib.pm'});
32 #my @ll_dir = File::Spec->splitdir($ll_path[1]);
33 #my $ll_dir = File::Spec->catpath($ll_path[0], File::Spec->catdir(@ll_dir[0 .. $#_-1]), '');
37 my $version = `$^X $0 --check-version $module`;
39 length $version ? $version : undef;
43 [ 'ExtUtils::MakeMaker' => 6.74 ],
44 [ 'ExtUtils::Install' => 1.43 ],
45 [ 'Module::Build' => 0.36 ],
48 plan tests => 1+@modules;
50 for my $module (@modules) {
51 my $version = check_version($module->[0]);
52 if ($version && $version >= $module->[1]) {
53 diag "Can't test bootstrap of $module->[0], version $version already meets requirement of $module->[1]";
57 $ENV{HOME} = my $home = File::Temp::tempdir( CLEANUP => 1 );
58 mkdir my $ll = File::Spec->catdir($home, 'perl5');
59 local::lib->import($ll);
62 my $out = Capture::Tiny::capture_merged {
63 $result = system($^X, 'Makefile.PL', '--bootstrap');
65 is $result, 0, 'Makefile.PL ran successfully'
68 for my $module (@modules) {
69 my $version = check_version($module->[0]);
70 cmp_ok $version, '>=', $module->[1], "bootstrap installed new enough $module->[0]";