use strict;
use Config;
-use Test::More tests => 79;
+use Test::More tests => 80;
use MakeMaker::Test::Utils;
use MakeMaker::Test::Setup::BFD;
use File::Find;
my $perl = which_perl();
my $Is_VMS = $^O eq 'VMS';
-chdir($Is_VMS ? 'BFD_TEST_ROOT:[t]' : 't');
+# GNV logical interferes with testing
+$ENV{'bin'} = '[.bin]' if $Is_VMS;
+chdir 't';
perl_lib;
' <DEPENDENCY>' );
like( $ppd_html, qr{^\s*<OS NAME="$Config{osname}" />}m,
' <OS>' );
-like( $ppd_html, qr{^\s*<ARCHITECTURE NAME="$Config{archname}" />}m,
+my $archname = $Config{archname};
+$archname .= "-". substr($Config{version},0,3) if $] >= 5.008;
+like( $ppd_html, qr{^\s*<ARCHITECTURE NAME="$archname" />}m,
' <ARCHITECTURE>');
like( $ppd_html, qr{^\s*<CODEBASE HREF="" />}m, ' <CODEBASE>');
like( $ppd_html, qr{^\s*</IMPLEMENTATION>}m, ' </IMPLEMENTATION>');
my %files = ();
find( sub {
# do it case-insensitive for non-case preserving OSs
- $files{lc $_} = $File::Find::name;
+ my $file = lc $_;
+
+ # VMS likes to put dots on the end of things that don't have them.
+ $file =~ s/\.$// if $Is_VMS;
+
+ $files{$file} = $File::Find::name;
}, '../dummy-install' );
ok( $files{'dummy.pm'}, ' Dummy.pm installed' );
ok( $files{'liar.pm'}, ' Liar.pm installed' );
+ok( $files{'program'}, ' program installed' );
ok( $files{'.packlist'}, ' packlist created' );
ok( $files{'perllocal.pod'},' perllocal.pod created' );
SKIP: {
- skip "VMS install targets do not preserve $(PREFIX)", 8 if $Is_VMS;
+ skip 'VMS install targets do not preserve $(PREFIX)', 9 if $Is_VMS;
$install_out = run("$make install PREFIX=elsewhere");
is( $?, 0, 'install with PREFIX override' ) || diag $install_out;
find( sub { $files{$_} = $File::Find::name; }, 'elsewhere' );
ok( $files{'Dummy.pm'}, ' Dummy.pm installed' );
ok( $files{'Liar.pm'}, ' Liar.pm installed' );
+ ok( $files{'program'}, ' program installed' );
ok( $files{'.packlist'}, ' packlist created' );
ok( $files{'perllocal.pod'},' perllocal.pod created' );
rmtree('elsewhere');
SKIP: {
- skip "VMS install targets do not preserve $(DESTDIR)", 10 if $Is_VMS;
+ skip 'VMS install targets do not preserve $(DESTDIR)', 11 if $Is_VMS;
$install_out = run("$make install PREFIX= DESTDIR=other");
is( $?, 0, 'install with DESTDIR' ) ||
}, 'other' );
ok( $files{'Dummy.pm'}, ' Dummy.pm installed' );
ok( $files{'Liar.pm'}, ' Liar.pm installed' );
+ ok( $files{'program'}, ' program installed' );
ok( $files{'.packlist'}, ' packlist created' );
ok( $files{'perllocal.pod'},' perllocal.pod created' );
SKIP: {
- skip "VMS install targets do not preserve $(PREFIX)", 9 if $Is_VMS;
+ skip 'VMS install targets do not preserve $(PREFIX)', 10 if $Is_VMS;
$install_out = run("$make install PREFIX=elsewhere DESTDIR=other/");
is( $?, 0, 'install with PREFIX override and DESTDIR' ) ||
find( sub { $files{$_} = $File::Find::name; }, 'other/elsewhere' );
ok( $files{'Dummy.pm'}, ' Dummy.pm installed' );
ok( $files{'Liar.pm'}, ' Liar.pm installed' );
+ ok( $files{'program'}, ' program installed' );
ok( $files{'.packlist'}, ' packlist created' );
ok( $files{'perllocal.pod'},' perllocal.pod created' );
rmtree('other');
# Test META.yml generation
use ExtUtils::Manifest qw(maniread);
-ok( -f 'META.yml', 'META.yml written' );
-my $manifest = maniread();
+
+my $distdir = 'Big-Dummy-0.01';
+$distdir =~ s/\./_/g if $Is_VMS;
+my $meta_yml = "$distdir/META.yml";
+
+ok( !-f 'META.yml', 'META.yml not written to source dir' );
+ok( -f $meta_yml, 'META.yml written to dist dir' );
+ok( !-e "META_new.yml", 'temp META.yml file not left around' );
+
+my $manifest = maniread("$distdir/MANIFEST");
# VMS is non-case preserving, so we can't know what the MANIFEST will
# look like. :(
_normalize($manifest);
is( $manifest->{'meta.yml'}, 'Module meta-data (added by MakeMaker)' );
-my $meta_mtime = (stat('META.yml'))[9];
-sleep 1;
-my $metafile_out = run("$make metafile");
-is( $?, 0, 'metafile' ) || diag($metafile_out);
-is( (stat('META.yml'))[9], $meta_mtime, 'META.yml untouched if not changed' );
-ok( !-e 'META_new.yml', 'temp META.yml file not left around' );
# Test NO_META META.yml suppression
-unlink 'META.yml';
-ok( !-f 'META.yml', 'META.yml deleted' );
+unlink $meta_yml;
+ok( !-f $meta_yml, 'META.yml deleted' );
@mpl_out = run(qq{$perl Makefile.PL "NO_META=1"});
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
-$metafile_out = run("$make metafile");
-is( $?, 0, 'metafile' ) || diag($metafile_out);
-ok( !-f 'META.yml', 'META.yml generation suppressed by NO_META' );
-
-# Test if MANIFEST is read-only.
-chmod 0444, 'MANIFEST';
-@mpl_out = run(qq{$perl Makefile.PL});
-cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
-$metafile_out = run("$make metafile_addtomanifest");
-is( $?, 0, q{metafile_addtomanifest didn't die with locked MANIFEST} ) ||
- diag($metafile_out);
+my $distdir_out = run("$make distdir");
+is( $?, 0, 'distdir' ) || diag($distdir_out);
+ok( !-f $meta_yml, 'META.yml generation suppressed by NO_META' );
# Make sure init_dirscan doesn't go into the distdir