From: Jerry D. Hedden Date: Thu, 21 Jun 2007 10:24:01 +0000 (-0400) Subject: Remove unused Module::Build tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2e219d7e25b5babddbc1b539346e48e7b94da290;p=p5sagit%2Fp5-mst-13.2.git Remove unused Module::Build tests From: "Jerry D. Hedden" Message-ID: <1ff86f510706210724v5ccd24d0md024fd5a941ee769@mail.gmail.com> p4raw-id: //depot/perl@31441 --- diff --git a/MANIFEST b/MANIFEST index 2998c6b..e438c32 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2156,11 +2156,9 @@ lib/Module/Build/t/moduleinfo.t Module::Build lib/Module/Build/t/new_from_context.t Module::Build lib/Module/Build/t/notes.t Module::Build lib/Module/Build/t/parents.t Module::Build -lib/Module/Build/t/par.t Module::Build lib/Module/Build/t/pod_parser.t Module::Build lib/Module/Build/t/ppm.t Module::Build lib/Module/Build/t/runthrough.t Module::Build -lib/Module/Build/t/signature.t Module::Build lib/Module/Build/t/test_types.t Module::Build lib/Module/Build/t/test_type.t Module::Build lib/Module/Build/t/tilde.t Module::Build diff --git a/lib/Module/Build/t/par.t b/lib/Module/Build/t/par.t deleted file mode 100644 index 3f0b121..0000000 --- a/lib/Module/Build/t/par.t +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib'; -use MBTest; -use Module::Build; -use Module::Build::ConfigData; - -{ - my ($have_c_compiler, $C_support_feature) = check_compiler(); - if (! $C_support_feature) { - plan skip_all => 'C_support not enabled'; - } elsif ( ! $have_c_compiler ) { - plan skip_all => 'C_support enabled, but no compiler found'; - } elsif ( ! eval {require PAR::Dist; PAR::Dist->VERSION(0.17)} ) { - plan skip_all => "PAR::Dist 0.17 or up not installed to check .par's."; - } elsif ( ! eval {require Archive::Zip} ) { - plan skip_all => "Archive::Zip required."; - } else { - plan tests => 3; - } -} - - -use Cwd (); -my $cwd = Cwd::cwd; -my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); - - -use DistGen; -my $dist = DistGen->new( dir => $tmp, xs => 1 ); -$dist->add_file( 'hello', <<'---' ); -#!perl -w -print "Hello, World!\n"; -__END__ - -=pod - -=head1 NAME - -hello - -=head1 DESCRIPTION - -Says "Hello" - -=cut ---- -$dist->change_file( 'Build.PL', <<"---" ); - -my \$build = new Module::Build( - module_name => @{[$dist->name]}, - version => '0.01', - license => 'perl', - scripts => [ 'hello' ], -); - -\$build->create_build_script; ---- -$dist->regen; - -chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; - -use File::Spec::Functions qw(catdir); - -use Module::Build; -my @installstyle = qw(lib perl5); -my $mb = Module::Build->new_from_context( - verbose => 0, - quiet => 1, - - installdirs => 'site', -); - -my $filename = $mb->dispatch('pardist'); - -ok( -f $filename, '.par distributions exists' ); -my $distname = $dist->name; -ok( $filename =~ /^\Q$distname\E/, 'Distribution name seems correct' ); - -my $meta; -eval { $meta = PAR::Dist::get_meta($filename) }; - -ok( - (not $@ and defined $meta and not $meta eq ''), - 'Distribution contains META.yml' -); - -$dist->clean(); - -chdir( $cwd ); -use File::Path; -rmtree( $tmp ); - diff --git a/lib/Module/Build/t/signature.t b/lib/Module/Build/t/signature.t deleted file mode 100644 index 6cb93b1..0000000 --- a/lib/Module/Build/t/signature.t +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/perl -w - -use strict; -use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib'; -use MBTest; - -if ( $ENV{TEST_SIGNATURE} ) { - if ( have_module( 'Module::Signature' ) ) { - plan tests => 7; - } else { - plan skip_all => '$ENV{TEST_SIGNATURE} is set, but Module::Signature not found'; - } -} else { - plan skip_all => '$ENV{TEST_SIGNATURE} is not set'; -} - -######################### - -use Cwd (); -my $cwd = Cwd::cwd; -my $tmp = File::Spec->catdir( $cwd, 't', '_tmp' ); - -use DistGen; -my $dist = DistGen->new( dir => $tmp ); -$dist->change_file( 'Build.PL', <<"---" ); -use Module::Build; - -my \$build = new Module::Build( - module_name => @{[$dist->name]}, - license => 'perl', - sign => 1, -); -\$build->create_build_script; ---- -$dist->regen; - -chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; - -######################### - -use Module::Build; - -my $mb = Module::Build->new_from_context; - - -{ - eval {$mb->dispatch('distdir')}; - is $@, ''; - chdir( $mb->dist_dir ) or die "Can't chdir to '@{[$mb->dist_dir]}': $!"; - ok -e 'SIGNATURE'; - - # Make sure the signature actually verifies - ok Module::Signature::verify() == Module::Signature::SIGNATURE_OK(); - chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; -} - -{ - # Fake out Module::Signature and Module::Build - the first one to - # run should be distmeta. - my @run_order; - { - local $^W; # Skip 'redefined' warnings - local *Module::Signature::sign = sub { push @run_order, 'sign' }; - local *Module::Build::Base::ACTION_distmeta = sub { push @run_order, 'distmeta' }; - eval { $mb->dispatch('distdir') }; - } - is $@, ''; - is $run_order[0], 'distmeta'; - is $run_order[1], 'sign'; -} - -eval { $mb->dispatch('realclean') }; -is $@, ''; - - -# cleanup -chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; -$dist->remove; - -use File::Path; -rmtree( $tmp );