4 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
7 use Module::Build::ConfigData;
10 my ($have_c_compiler, $C_support_feature) = check_compiler();
11 if (! $C_support_feature) {
12 plan skip_all => 'C_support not enabled';
13 } elsif ( ! $have_c_compiler ) {
14 plan skip_all => 'C_support enabled, but no compiler found';
15 } elsif ( ! eval {require PAR::Dist; PAR::Dist->VERSION(0.17)} ) {
16 plan skip_all => "PAR::Dist 0.17 or up not installed to check .par's.";
17 } elsif ( ! eval {require Archive::Zip} ) {
18 plan skip_all => "Archive::Zip required.";
27 my $tmp = MBTest->tmpdir;
31 my $dist = DistGen->new( dir => $tmp, xs => 1 );
32 $dist->add_file( 'hello', <<'---' );
34 print "Hello, World!\n";
49 $dist->change_build_pl
51 module_name => $dist->name,
54 scripts => [ 'hello' ],
58 chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!";
60 use File::Spec::Functions qw(catdir);
63 my @installstyle = qw(lib perl5);
64 my $mb = Module::Build->new_from_context(
68 installdirs => 'site',
71 my $filename = $mb->dispatch('pardist');
73 ok( -f $filename, '.par distributions exists' );
74 my $distname = $dist->name;
75 ok( $filename =~ /^\Q$distname\E/, 'Distribution name seems correct' );
78 eval { $meta = PAR::Dist::get_meta($filename) };
81 (not $@ and defined $meta and not $meta eq ''),
82 'Distribution contains META.yml'