diff options
author | Jerry D. Hedden <jdhedden@cpan.org> | 2007-06-21 06:24:01 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-06-21 14:54:32 +0000 |
commit | 2e219d7e25b5babddbc1b539346e48e7b94da290 (patch) | |
tree | ef8fcde87b57a854ebd264541710b558bfcb968f /lib/Module | |
parent | e4f3fca48b547d000a2f9fa8f3ca08566d87f410 (diff) | |
download | perl-2e219d7e25b5babddbc1b539346e48e7b94da290.tar.gz |
Remove unused Module::Build tests
From: "Jerry D. Hedden" <jdhedden@cpan.org>
Message-ID: <1ff86f510706210724v5ccd24d0md024fd5a941ee769@mail.gmail.com>
p4raw-id: //depot/perl@31441
Diffstat (limited to 'lib/Module')
-rw-r--r-- | lib/Module/Build/t/par.t | 94 | ||||
-rw-r--r-- | lib/Module/Build/t/signature.t | 81 |
2 files changed, 0 insertions, 175 deletions
diff --git a/lib/Module/Build/t/par.t b/lib/Module/Build/t/par.t deleted file mode 100644 index 3f0b1218d6..0000000000 --- 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 6cb93b1c27..0000000000 --- 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 ); |