1 # *NOTE* This is executed by basic.t and is included in both ExtUtils-MakeMaker
2 # as well as Perlcore. Note also that it is expected to be executed in a do "FILE"
3 # immediately after basic.plt is executed (similarly).
5 # It is NOT expected to be executed under ExtUtils-Install alone, and in fact is not
6 # distributed there, however it is expected to be executed under ExtUtils-MakeMaker
9 my $dist_test_out = run("$make disttest");
10 is( $?, 0, 'disttest' ) || diag($dist_test_out);
12 # Test META.yml generation
13 use ExtUtils::Manifest qw(maniread);
15 my $distdir = 'Big-Dummy-0.01';
16 $distdir =~ s/\./_/g if $Is_VMS;
17 my $meta_yml = "$distdir/META.yml";
19 ok( !-f 'META.yml', 'META.yml not written to source dir' );
20 ok( -f $meta_yml, 'META.yml written to dist dir' );
21 ok( !-e "META_new.yml", 'temp META.yml file not left around' );
24 # META.yml spec 1.4 was added in 0.11
25 skip "Test::YAML::Meta >= 0.11 required", 2
26 unless eval { require Test::YAML::Meta } and
27 Test::YAML::Meta->VERSION >= 0.11;
29 Test::YAML::Meta::meta_spec_ok($meta_yml);
32 ok open META, $meta_yml or diag $!;
33 my $meta = join '', <META>;
40 abstract: Try "our" hot dog's
42 - Michael G Schwern <schwern\@pobox.com>
44 distribution_type: module
46 ExtUtils::MakeMaker: 0
53 generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION
55 url: http://module-build.sourceforge.net/META-spec-v1.4.html
59 my $manifest = maniread("$distdir/MANIFEST");
60 # VMS is non-case preserving, so we can't know what the MANIFEST will
62 _normalize($manifest);
63 is( $manifest->{'meta.yml'}, 'Module meta-data (added by MakeMaker)' );
66 # Test NO_META META.yml suppression
68 ok( !-f $meta_yml, 'META.yml deleted' );
69 @mpl_out = run(qq{$perl Makefile.PL "NO_META=1"});
70 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
71 my $distdir_out = run("$make distdir");
72 is( $?, 0, 'distdir' ) || diag($distdir_out);
73 ok( !-f $meta_yml, 'META.yml generation suppressed by NO_META' );
76 # Make sure init_dirscan doesn't go into the distdir
77 @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
79 cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
81 ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1,
82 'init_dirscan skipped distdir') ||
85 # I know we'll get ignored errors from make here, that's ok.
86 # Send STDERR off to oblivion.
87 open(SAVERR, ">&STDERR") or die $!;
88 open(STDERR, ">".File::Spec->devnull) or die $!;
90 my $realclean_out = run("$make realclean");
91 is( $?, 0, 'realclean' ) || diag($realclean_out);
93 open(STDERR, ">&SAVERR") or die $!;
100 while(my($k,$v) = each %$hash) {