[Module-build-checkins] Module-Build/t ppm.t,NONE,1.1 manifypods.t,1.18,1.19 xs.t,1.32,1.33
Status: Beta
Brought to you by:
kwilliams
From: Randy W. S. <si...@us...> - 2005-11-21 06:25:11
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24399/t Modified Files: manifypods.t xs.t Added Files: ppm.t Log Message: Add tests for contents of the ppm distros we create to ensure everything is in the right place. May need platform tweaks. Index: manifypods.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/manifypods.t,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- manifypods.t 21 Nov 2005 03:29:42 -0000 1.18 +++ manifypods.t 21 Nov 2005 06:24:58 -0000 1.19 @@ -157,7 +157,7 @@ ok !$mb2->get_action_docs('foo'); # Make sure those docs are the correct ones -foreach ('ppd', 'disttest') { +foreach ('testcover', 'disttest') { my $docs = $mb2->get_action_docs($_); like $docs, qr/=item $_/; unlike $docs, qr/\n=/, $docs; --- NEW FILE: ppm.t --- #!/usr/bin/perl -w use lib 't/lib'; use strict; use Test::More; unless ( eval {require Archive::Tar} ) { plan skip_all => "Archive::Tar not installed; can't test archives."; } else { plan tests => 9; } use File::Spec (); my $common_pl = File::Spec->catfile( 't', 'common.pl' ); require $common_pl; 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', <<"---" ); use Module::Build; my \$build = new Module::Build( module_name => @{[$dist->name]}, 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', config => { installsiteman1dir => catdir($tmp, 'site', 'man', 'man1'), installsiteman3dir => catdir($tmp, 'site', 'man', 'man3'), installsitehtml1dir => catdir($tmp, 'site', 'html'), installsitehtml3dir => catdir($tmp, 'site', 'html'), }, ); $mb->dispatch('ppd', args => {codebase => '/path/to/codebase-xs'}); (my $dist_filename = $dist->name) =~ s/::/-/g; my $ppd = slurp($dist_filename . '.ppd'); my $perl_version = Module::Build::PPMMaker->_ppd_version($mb->perl_version); my $varchname = Module::Build::PPMMaker->_varchname($mb->config); # This test is quite a hack since with XML you don't really want to # do a strict string comparison, but absent an XML parser it's the # best we can do. is $ppd, <<"---"; <SOFTPKG NAME="$dist_filename" VERSION="0,01,0,0"> <TITLE>@{[$dist->name]}</TITLE> <ABSTRACT>Perl extension for blah blah blah</ABSTRACT> <AUTHOR>A. U. Thor, a.u.thor\@a.galaxy.far.far.away</AUTHOR> <IMPLEMENTATION> <PERLCORE VERSION="$perl_version" /> <OS NAME="$^O" /> <ARCHITECTURE NAME="$varchname" /> <CODEBASE HREF="/path/to/codebase-xs" /> </IMPLEMENTATION> </SOFTPKG> --- $mb->dispatch('ppmdist'); is $@, ''; my $tar = Archive::Tar->new; my $tarfile = $mb->ppm_name . '.tar.gz'; $tar->read( $tarfile, 1 ); ok $tar->contains_file('blib/arch/auto/Simple/Simple.' . $mb->config('dlext')); ok $tar->contains_file('blib/lib/Simple.pm'); ok $tar->contains_file('blib/script/hello'); ok $tar->contains_file('blib/man3/Simple.' . $mb->config('man3ext')); ok $tar->contains_file('blib/man1/hello.' . $mb->config('man1ext')); ok $tar->contains_file('blib/html/site/lib/Simple.html'); ok $tar->contains_file('blib/html/bin/hello.html'); chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; $dist->remove; use File::Path; rmtree( $tmp ); Index: xs.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/xs.t,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- xs.t 20 Oct 2005 16:45:19 -0000 1.32 +++ xs.t 21 Nov 2005 06:24:58 -0000 1.33 @@ -26,7 +26,7 @@ } elsif ( !$have_c_compiler ) { plan skip_all => 'C_support enabled, but no compiler found'; } else { - plan tests => 15; + plan tests => 14; } } @@ -90,32 +90,6 @@ eval {$mb->dispatch('test')}; is $@, ''; -{ - $mb->dispatch('ppd', args => {codebase => '/path/to/codebase-xs'}); - - (my $dist_filename = $dist->name) =~ s/::/-/g; - my $ppd = slurp($dist_filename . '.ppd'); - - my $perl_version = Module::Build::PPMMaker->_ppd_version($mb->perl_version); - my $varchname = Module::Build::PPMMaker->_varchname($mb->config); - - # This test is quite a hack since with XML you don't really want to - # do a strict string comparison, but absent an XML parser it's the - # best we can do. - is $ppd, <<"EOF"; -<SOFTPKG NAME="$dist_filename" VERSION="0,01,0,0"> - <TITLE>@{[$dist->name]}</TITLE> - <ABSTRACT>Perl extension for blah blah blah</ABSTRACT> - <AUTHOR>A. U. Thor, a.u.thor\@a.galaxy.far.far.away</AUTHOR> - <IMPLEMENTATION> - <PERLCORE VERSION="$perl_version" /> - <OS NAME="$^O" /> - <ARCHITECTURE NAME="$varchname" /> - <CODEBASE HREF="/path/to/codebase-xs" /> - </IMPLEMENTATION> -</SOFTPKG> -EOF -} SKIP: { skip( "skipping a couple Unixish-only tests", 2 ) |