diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-11-26 10:37:36 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-11-26 10:37:36 +0000 |
commit | c8d65f1035cb1d70dc2830289eaeb81b4e0d2ff8 (patch) | |
tree | c9904aa722129ae0eda22d403ee8d88f06f5adbf /lib/ExtUtils/t | |
parent | 10fdd3268bfedb0d10912f2f0ba6be13995de3fe (diff) | |
download | perl-c8d65f1035cb1d70dc2830289eaeb81b4e0d2ff8.tar.gz |
Upgrade to ExtUtils::MakeMaker 6.37_02
p4raw-id: //depot/perl@32494
Diffstat (limited to 'lib/ExtUtils/t')
-rw-r--r-- | lib/ExtUtils/t/MM_Unix.t | 4 | ||||
-rw-r--r-- | lib/ExtUtils/t/WriteEmptyMakefile.t | 2 | ||||
-rw-r--r-- | lib/ExtUtils/t/basic.t | 21 | ||||
-rw-r--r-- | lib/ExtUtils/t/parse_version.t | 31 | ||||
-rw-r--r-- | lib/ExtUtils/t/prereq.t | 2 | ||||
-rw-r--r-- | lib/ExtUtils/t/writemakefile_args.t | 4 | ||||
-rw-r--r-- | lib/ExtUtils/t/xs.t | 41 |
7 files changed, 89 insertions, 16 deletions
diff --git a/lib/ExtUtils/t/MM_Unix.t b/lib/ExtUtils/t/MM_Unix.t index 1930e35cef..f9b07f8c0c 100644 --- a/lib/ExtUtils/t/MM_Unix.t +++ b/lib/ExtUtils/t/MM_Unix.t @@ -37,9 +37,7 @@ my $os = ($ExtUtils::MM_Unix::Is_OS2 || 0) + ($ExtUtils::MM_Unix::Is_VMS || 0); ok ( $os <= 1, 'There can be only one (or none)'); -my $version = $ExtUtils::MM_Unix::VERSION; - $version =~ s/_//g; -cmp_ok ($version, '>=', '1.12606', 'Should be at least version 1.12606'); +cmp_ok ($ExtUtils::MM_Unix::VERSION, '>=', '1.12606', 'Should be at least version 1.12606'); # when the following calls like canonpath, catdir etc are replaced by # File::Spec calls, the test's become a bit pointless diff --git a/lib/ExtUtils/t/WriteEmptyMakefile.t b/lib/ExtUtils/t/WriteEmptyMakefile.t index e9db02b881..a5de6f16c9 100644 --- a/lib/ExtUtils/t/WriteEmptyMakefile.t +++ b/lib/ExtUtils/t/WriteEmptyMakefile.t @@ -15,7 +15,7 @@ BEGIN { chdir 't'; use strict; -use Test::More 'no_plan'; +use Test::More tests => 5; use ExtUtils::MakeMaker qw(WriteEmptyMakefile); use TieOut; diff --git a/lib/ExtUtils/t/basic.t b/lib/ExtUtils/t/basic.t index 6b9002a5c1..64352d85cb 100644 --- a/lib/ExtUtils/t/basic.t +++ b/lib/ExtUtils/t/basic.t @@ -15,6 +15,7 @@ BEGIN { use strict; use Config; +use ExtUtils::MakeMaker; use Test::More tests => 83; use MakeMaker::Test::Utils; @@ -250,10 +251,26 @@ ok( -f $meta_yml, 'META.yml written to dist dir' ); ok( !-e "META_new.yml", 'temp META.yml file not left around' ); ok open META, $meta_yml or diag $!; -my @meta = <META>; -like $meta[-1], '/\n$/', "META.yml ends with a newline"; +my $meta = join '', <META>; ok close META; +is $meta, <<"END"; +--- #YAML:1.0 +name: Big-Dummy +version: 0.01 +abstract: Try "our" hot dog's +license: ~ +author: + - Michael G Schwern <schwern\@pobox.com> +generated_by: ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION +distribution_type: module +requires: + strict: 0 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.3.html + version: 1.3 +END + my $manifest = maniread("$distdir/MANIFEST"); # VMS is non-case preserving, so we can't know what the MANIFEST will # look like. :( diff --git a/lib/ExtUtils/t/parse_version.t b/lib/ExtUtils/t/parse_version.t index 78ba52e3a8..488e855064 100644 --- a/lib/ExtUtils/t/parse_version.t +++ b/lib/ExtUtils/t/parse_version.t @@ -14,6 +14,9 @@ chdir 't'; use Test::More; use ExtUtils::MakeMaker; +my $Has_Version = eval 'require version; "version"->import'; +my $Has_Our = eval 'our $foo'; + my %versions = (q[$VERSION = '1.00'] => '1.00', q[*VERSION = \'1.01'] => '1.01', q[($VERSION) = q$Revision: 32208 $ =~ /(\d+)/g;] => 32208, @@ -29,25 +32,43 @@ my %versions = (q[$VERSION = '1.00'] => '1.00', q[local $FOO::VERSION = '1.30'] => 'undef', ); -if( eval 'our $foo' ) { +if( $Has_Our ) { $versions{q[our $VERSION = '1.23';]} = '1.23', } -if( eval 'require version; "version"->import' ) { +if( $Has_Version ) { $versions{q[use version; $VERSION = qv(1.2.3);]} = qv(1.2.3); $versions{q[$VERSION = qv(1.2.3)]} = qv(1.2.3); } -plan tests => 2 * keys %versions; +plan tests => (2 * keys %versions) + 4; while( my($code, $expect) = each %versions ) { + is( parse_version_string($code), $expect, $code ); +} + + +sub parse_version_string { + my $code = shift; + open(FILE, ">VERSION.tmp") || die $!; print FILE "$code\n"; close FILE; $_ = 'foo'; - is( MM->parse_version('VERSION.tmp'), $expect, $code ); + my $version = MM->parse_version('VERSION.tmp'); is( $_, 'foo', '$_ not leaked by parse_version' ); - + unlink "VERSION.tmp"; + + return $version; +} + + +SKIP: { + skip "need version.pm", 2 unless $Has_Version; + is parse_version_string(q[ $VERSION = '1.00'; sub version { $VERSION } ]), + '1.00'; + is parse_version_string(q[ use version; $VERSION = version->new(1.23) ]), + '1.23'; } diff --git a/lib/ExtUtils/t/prereq.t b/lib/ExtUtils/t/prereq.t index e450f089d1..486fee9ebe 100644 --- a/lib/ExtUtils/t/prereq.t +++ b/lib/ExtUtils/t/prereq.t @@ -14,7 +14,7 @@ BEGIN { } use strict; -use Test::More 'no_plan'; +use Test::More tests => 11; use TieOut; use MakeMaker::Test::Utils; diff --git a/lib/ExtUtils/t/writemakefile_args.t b/lib/ExtUtils/t/writemakefile_args.t index e7b2db5ec2..da274d6cc7 100644 --- a/lib/ExtUtils/t/writemakefile_args.t +++ b/lib/ExtUtils/t/writemakefile_args.t @@ -14,7 +14,7 @@ BEGIN { } use strict; -use Test::More 'no_plan'; +use Test::More tests => 28; use TieOut; use MakeMaker::Test::Utils; @@ -164,7 +164,7 @@ VERIFY SKIP: { - skip("Can't test version objects",2) unless eval { require version }; + skip("Can't test version objects",6) unless eval { require version }; version->import; my $version = version->new("1.2.3"); diff --git a/lib/ExtUtils/t/xs.t b/lib/ExtUtils/t/xs.t index 62d29eae79..1cadc109b7 100644 --- a/lib/ExtUtils/t/xs.t +++ b/lib/ExtUtils/t/xs.t @@ -13,12 +13,49 @@ chdir 't'; use Test::More; use MakeMaker::Test::Utils; +use MakeMaker::Test::Setup::XS; +use File::Find; +use File::Spec; +use File::Path; if( have_compiler() ) { - plan tests => 1; + plan tests => 7; } else { plan skip_all => "ExtUtils::CBuilder not installed or couldn't find a compiler"; } -pass("You have a compiler, isn't that great?"); +my $Is_VMS = $^O eq 'VMS'; +my $perl = which_perl(); + +# GNV logical interferes with testing +$ENV{'bin'} = '[.bin]' if $Is_VMS; + +chdir 't'; + +perl_lib; + +$| = 1; + +ok( setup_xs(), 'setup' ); +END { + ok( chdir File::Spec->updir ); + ok( teardown_xs(), 'teardown' ); +} + +ok( chdir('XS-Test'), "chdir'd to XS-Test" ) || + diag("chdir failed: $!"); + +my @mpl_out = run(qq{$perl Makefile.PL}); + +cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || + diag(@mpl_out); + +my $make = make_run(); +my $make_out = run("$make"); +is( $?, 0, ' make exited normally' ) || + diag $make_out; + +my $test_out = run("$make"); +is( $?, 0, ' make test exited normally' ) || + diag $test_out; |