diff options
author | 2014-03-24 14:58:42 +0000 | |
---|---|---|
committer | 2014-03-24 14:58:42 +0000 | |
commit | 91f110e064cd7c194e59e019b83bb7496c1c84d4 (patch) | |
tree | 3e8e577405dba7e94b43cbf21c22f21aaa5ab949 /gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t | |
parent | do not call purge_task every 10 secs, it is only needed once at startup and (diff) | |
download | wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.tar.xz wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.zip |
Import perl-5.18.2
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t')
11 files changed, 128 insertions, 68 deletions
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/01perl_bugs.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/01perl_bugs.t new file mode 100644 index 00000000000..618dc092784 --- /dev/null +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/01perl_bugs.t @@ -0,0 +1,25 @@ +#!/usr/bin/env perl -w + +# Inform the user early and clearly that their Perl is broken beyond redemption + +use strict; +use warnings; + +use lib 't/lib'; + +use Test::More; + +note "The 0.01 / Gconvert bug"; { + my $number = 0.01; + my $string = "VERSION=$number"; + + is "VERSION=$number", "VERSION=0.01" or do { + diag <<END; +Sorry, but your perl's ability to translate decimal numbers to strings +is broken. You should probably recompile it with -Dd_Gconvert=sprintf +or upgrade to a newer version of Perl. +END + }; +} + +done_testing; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/FIRST_MAKEFILE.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/FIRST_MAKEFILE.t index 6de5a73e947..71f65f8bd50 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/FIRST_MAKEFILE.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/FIRST_MAKEFILE.t @@ -31,4 +31,4 @@ cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag @mpl_out; ok( -e 'jakefile', 'FIRST_MAKEFILE honored' ); ok( grep(/^Writing jakefile(?:\.)? for Big::Dummy/, @mpl_out) == 1, - 'Makefile.PL output looks right' ); + 'Makefile.PL output looks right' ); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/Liblist.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/Liblist.t index 7161fd373b5..37d10a1c6e7 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/Liblist.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/Liblist.t @@ -24,5 +24,5 @@ ok( defined &ExtUtils::Liblist::ext, unlike( $out[2], qr/-ln0tt43r3_perl/, 'bogus library not added' ); ok( @warn, 'had warning'); - is( grep(/\QNote (probably harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag join "\n", @warn; + is( grep(/\QWarning (mostly harmless): No library found for \E(-l)?n0tt43r3_perl/, map { @$_ } @warn), 1 ) || diag join "\n", @warn; } diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_OS2.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_OS2.t index 4d88e85f28c..08d0e1abab2 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_OS2.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_OS2.t @@ -42,7 +42,7 @@ delete $mm->{SKIPHASH}; my $res = $mm->dlsyms(); like( $res, qr/baseext\.def: Makefile/, '... without flag, should return make targets' ); -like( $res, qr/"DL_FUNCS" => { }/, +like( $res, qr/"DL_FUNCS" => \{ \}/, '... should provide empty hash refs where necessary' ); like( $res, qr/"DL_VARS" => \[]/, '... and empty array refs too' ); diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t index 4bc030d9021..6d4bf8d2885 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/MM_Win32.t @@ -272,12 +272,6 @@ unlink "${script_name}$script_ext" if -f "${script_name}$script_ext"; # dist_ci() should look into that # dist_core() should look into that -# pasthru() -{ - my $pastru = "PASTHRU = " . ($Config{make} =~ /^nmake/i ? "-nologo" : ""); - is( $MM->pasthru(), $pastru, 'pasthru()' ); -} - # _identify_compiler_environment() { sub _run_cc_id { diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t index fb374c0c9b8..1410465a9f4 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/basic.t @@ -412,8 +412,5 @@ close SAVERR; sub _normalize { my $hash = shift; - while(my($k,$v) = each %$hash) { - delete $hash->{$k}; - $hash->{lc $k} = $v; - } + %$hash= map { lc($_) => $hash->{$_} } keys %$hash; } diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/hints.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/hints.t index ab9d9553f7e..19bee553cd1 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/hints.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/hints.t @@ -1,8 +1,9 @@ #!/usr/bin/perl -w -BEGIN { - unshift @INC, 't/lib/'; -} +use strict; +use warnings; + +use lib 't/lib'; chdir 't'; use File::Spec; @@ -13,36 +14,55 @@ use Test::More tests => 3; my $curdir = File::Spec->curdir; @INC = grep { $_ ne $curdir && $_ ne '.' } @INC; +use ExtUtils::MakeMaker; + +# Make a hints directory for testing mkdir('hints', 0777); (my $os = $^O) =~ s/\./_/g; -my $hint_file = File::Spec->catfile('hints', "$os.pl"); +my $Hint_File = File::Spec->catfile('hints', "$os.pl"); -open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!"; -print HINT <<'CLOO'; + +my $mm = bless {}, 'ExtUtils::MakeMaker'; + +# Write a hints file for testing +{ + open my $hint_fh, ">", $Hint_File || die "Can't write dummy hints file $Hint_File: $!"; + print $hint_fh <<'CLOO'; $self->{CCFLAGS} = 'basset hounds got long ears'; CLOO -close HINT; +} -use TieOut; -use ExtUtils::MakeMaker; +# Test our hint file is detected +{ + my $stderr = ''; + local $SIG{__WARN__} = sub { $stderr .= join '', @_ }; + + $mm->check_hints; + is( $mm->{CCFLAGS}, 'basset hounds got long ears' ); + is( $stderr, "Processing hints file $Hint_File\n" ); +} -my $out = tie *STDERR, 'TieOut'; -my $mm = bless {}, 'ExtUtils::MakeMaker'; -$mm->check_hints; -is( $mm->{CCFLAGS}, 'basset hounds got long ears' ); -is( $out->read, "Processing hints file $hint_file\n" ); -open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!"; -print HINT <<'CLOO'; +# Test a hint file which dies +{ + open my $hint_fh, ">", $Hint_File || die "Can't write dummy hints file $Hint_File: $!"; + print $hint_fh <<'CLOO'; die "Argh!\n"; CLOO -close HINT; +} + -$mm->check_hints; -is( $out->read, <<OUT, 'hint files produce errors' ); -Processing hints file $hint_file +# Test the hint file which produces errors +{ + my $stderr = ''; + local $SIG{__WARN__} = sub { $stderr .= join '', @_ }; + + $mm->check_hints; + is( $stderr, <<OUT, 'hint files produce errors' ); +Processing hints file $Hint_File Argh! OUT +} END { use File::Path; diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t index 4c8fa76231b..1fb8d10b9dc 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/metafile_data.t @@ -3,7 +3,7 @@ BEGIN { } use strict; -use Test::More tests => 19; +use Test::More tests => 22; use Data::Dumper; use File::Temp; @@ -402,29 +402,37 @@ my $new_mm = sub { version => '6.57_07', abstract => 'Create a module Makefile', author => ['Michael G Schwern <schwern@pobox.com>'], - license => 'perl', + license => ['perl_5'], dynamic_config => 0, - requires => { - "DirHandle" => 0, - "File::Basename" => 0, - "File::Spec" => "0.8", - "Pod::Man" => 0, - "perl" => "5.006" - }, - - configure_requires => { - }, - build_requires => { - 'Fake::Module1' => 1.01, + prereqs => { + runtime => { + requires => { + "DirHandle" => 0, + "File::Basename" => 0, + "File::Spec" => "0.8", + "Pod::Man" => 0, + "perl" => "5.006", + }, + }, + configure => { + requires => { + }, + }, + build => { + requires => { + 'Fake::Module1' => 1.01, + }, + }, }, + release_status => 'testing', resources => { - license => 'http://dev.perl.org/licenses/', - homepage => 'http://makemaker.org', - bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker', - repository => 'http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker', - x_MailingList => 'makemaker@perl.org', + license => [ 'http://dev.perl.org/licenses/' ], + homepage => 'http://makemaker.org', + bugtracker => { web => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=ExtUtils-MakeMaker' }, + repository => { url => 'http://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker' }, + x_MailingList => 'makemaker@perl.org', }, no_index => { @@ -434,8 +442,8 @@ my $new_mm = sub { generated_by => "ExtUtils::MakeMaker version 6.5707, CPAN::Meta::Converter version 2.110580", 'meta-spec' => { - url => 'http://module-build.sourceforge.net/META-spec-v1.4.html', - version => 1.4 + url => 'http://search.cpan.org/perldoc?CPAN::Meta::Spec', + version => 2, }, }; @@ -448,6 +456,28 @@ my $new_mm = sub { 'MYMETA YAML data (BUILD_REQUIRES wins)'; } +{ + my $mm = $new_mm->( + DISTNAME => 'Foo-Bar', + VERSION => 1.23, + BUILD_REQUIRES => { "Fake::Module1" => 1.01 }, + TEST_REQUIRES => { "Fake::Module2" => 1.23 }, + ); + + my $meta = $mm->mymeta('t/META_for_testing.json'); + is($meta->{build_requires}, undef, "no build_requires in v2 META"); + is_deeply( + $meta->{prereqs}{build}{requires}, + { "Fake::Module1" => 1.01 }, + "build requires are one thing in META v2...", + ); + + is_deeply( + $meta->{prereqs}{test}{requires}, + { "Fake::Module2" => 1.23 }, + "...and test requires are another", + ); +} note "CPAN::Meta bug using the module version instead of the meta spec version"; { my $mm = $new_mm->( @@ -462,7 +492,7 @@ note "CPAN::Meta bug using the module version instead of the meta spec version"; ); my $meta = $mm->mymeta("t/META_for_testing_tricky_version.yml"); - is $meta->{'meta-spec'}{version}, 1.4; + is $meta->{'meta-spec'}{version}, 2, "internally, our MYMETA struct is v2"; in_dir { $mm->write_mymeta($meta); @@ -475,7 +505,6 @@ note "CPAN::Meta bug using the module version instead of the meta spec version"; my $meta_json = Parse::CPAN::Meta->load_file("MYMETA.json"); cmp_ok $meta_json->{'meta-spec'}{version}, ">=", 2, "MYMETA.json at 2 or better"; }; - } diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/parse_abstract.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/parse_abstract.t index 03e56c932e4..5ced676a5e0 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/parse_abstract.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/parse_abstract.t @@ -3,8 +3,9 @@ use strict; use warnings; +use lib 't/lib'; use ExtUtils::MakeMaker; - +use File::Temp qw[tempfile]; use Test::More 'no_plan'; sub test_abstract { @@ -12,12 +13,9 @@ sub test_abstract { local $Test::Builder::Level = $Test::Builder::Level + 1; - my $file = "t/abstract.tmp"; - { - open my $fh, ">", $file or die "Can't open $file"; - print $fh $code; - close $fh; - } + my ($fh,$file) = tempfile( DIR => 't', UNLINK => 1 ); + print $fh $code; + close $fh; # Hack up a minimal MakeMaker object. my $mm = bless { DISTNAME => $package }, "MM"; @@ -25,9 +23,6 @@ sub test_abstract { my $ok = is( $have, $want, $name ); - # Clean up the temp file, VMS style - 1 while unlink $file; - return $ok; } diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/pod2man.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/pod2man.t index 1632234b15f..d206e0bc956 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/pod2man.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/pod2man.t @@ -38,7 +38,7 @@ use Test::More tests => 3; $warnings .= join '', @_; }; - is pod2man(), undef; + ok !pod2man(); is $warnings, <<'END' Pod::Man is not available: Simulated Pod::Man failure Man pages will not be generated during this install. diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/xs.t b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/xs.t index efd682edfd3..5cb17c2fedf 100755 --- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/xs.t +++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/xs.t @@ -53,6 +53,6 @@ my $make_out = run("$make"); is( $?, 0, ' make exited normally' ) || diag $make_out; -my $test_out = run("$make"); +my $test_out = run("$make test"); is( $?, 0, ' make test exited normally' ) || diag $test_out; |