Re: running tests
* Andy Lester andy at petdance.com [2004/04/02 16:59]: Sure, but even better is to run only the tests that need to be run, which is a key part of prove. You can run prove -Mblib t/mytest.t instead of the entire make test suite. $ make test TEST_FILES=t/mytest.t (darren) -- An idea is not responsible for the people who believe in it. pgp0.pgp Description: PGP signature
Re: running tests
$ make test TEST_FILES=t/mytest.t Sure, and you can turn on HARNESS_VERBOSE to get the raw output of the .t file. prove puts all that stuff behind easy command-line switches, and lets you specify wildcards, and lets you specify a directory that implicitly does all the *.t within the directory, and lets you turn on taint checking, and... xoa -- Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance
Re: running tests
[EMAIL PROTECTED] (Andy Lester) writes: Sure, and you can turn on HARNESS_VERBOSE to get the raw output of the .t file. prove puts all that stuff behind easy command-line switches, and lets you specify wildcards, and lets you specify a directory that implicitly does all the *.t within the directory, and lets you turn on taint checking, and... And, unlike the bizarre corners of ExtUtils::MakeMaker, is actually documented! -- Do you associate ST JOHN'S with addiction to ASIA FILE? - Henry Braun is Oxford Zippy
Re: running tests
On Mon, Apr 05, 2004 at 05:05:34PM +0100, Simon Cozens wrote: [EMAIL PROTECTED] (Andy Lester) writes: Sure, and you can turn on HARNESS_VERBOSE to get the raw output of the .t file. prove puts all that stuff behind easy command-line switches, and lets you specify wildcards, and lets you specify a directory that implicitly does all the *.t within the directory, and lets you turn on taint checking, and... And, unlike the bizarre corners of ExtUtils::MakeMaker, is actually documented! 'prove' has really made a big difference for me. With 'make test', I had the sense there were ways to fine tune the output. But how to do that seemed different to discover, and difficult to remember. With prove, there's 'prove -h' and 'perldoc prove', making things much easier to learn and lookup. Since it is 100% compatible with the test files already in use, there is nothing to lose by trying it or using it. It's not as if it's a new dependency that module users have to to have to install it. Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark StosbergPrincipal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . .
Re: running tests
there's 'prove -h' and 'perldoc prove', making things much easier to learn and lookup. And, for that matter, prove --man == perldoc prove xoa -- Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance
Module::Starter released
I've just released Module::Starter 0.02, meant as a replacement for h2xs. I think h2xs is very out of date as far as current best practices for modules. It's also very intimidating for people who just want to create a module, and have no need for all the compiler hoohah that h2xs throws at you. Module::Starter is meant to make things much eaiser. Here's a sample run of Module::Starter's command-line program: $ module-starter --module=Foo,Foo::Bar,Foo::Bat \ [EMAIL PROTECTED] --author=Andy Lester $ find Foo Foo Foo/.cvsignore Foo/Changes Foo/lib Foo/lib/Foo Foo/lib/Foo/Bar.pm Foo/lib/Foo/Bat.pm Foo/lib/Foo.pm Foo/Makefile.PL Foo/MANIFEST Foo/t Foo/t/00.load.t Foo/t/pod-coverage.t Foo/t/pod.t $ cat Foo/Makefile.PL use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME= 'Foo', AUTHOR = 'Andy Lester [EMAIL PROTECTED]', VERSION_FROM= 'lib/Foo.pm', ABSTRACT_FROM = 'lib/Foo.pm', PREREQ_PM = { 'Test::More' = 0, }, dist= { COMPRESS = 'gzip -9f', SUFFIX = 'gz', }, clean = { FILES = 'Foo-*' }, ); Comments are welcome, and expected. xoa -- Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance
Re: Module::Starter released
On Mon, Apr 05, 2004 at 02:15:30PM -0500, Andy Lester wrote: I've just released Module::Starter 0.02, meant as a replacement for h2xs. I think h2xs is very out of date as far as current best practices for modules. It's also very intimidating for people who just want to create a module, and have no need for all the compiler hoohah that h2xs throws at you. Module::Starter is meant to make things much eaiser. Here's a sample run of Module::Starter's command-line program: Thanks Andy. Here's an initial comment: I think would useful to include ExtUtils::ModuleMaker in a SEE ALSO section, and explain the key differences. At first glance the projects seem quite similar. Mark -- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark StosbergPrincipal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . .
Re: Module::Starter released
Andy Lester wrote: I've just released Module::Starter 0.02, meant as a replacement for h2xs. I just reinstalled Debian on my laptop with the default perl (5.6.1). The following are the modules required and requested for Module::Starter and its dependents. Not complaining or making any judgement, just thought it interesting. Archive-Tar-1.08 Devel-CoreStack-1.3 Devel-Symdump-2.03 ExtUtils-CBuilder-0.02 ExtUtils-ParseXS-2.08 Module-Build-0.24 Pod-Coverage-0.13 Pod-Escapes-1.03 Pod-Simple-2.05 Test-Builder-Tester-0.09 Test-Harness-2.40 Test-Pod-1.12 Test-Pod-Coverage-0.08 Test-Simple-0.47 YAML-0.35
Re: Module::Starter released
Andy Lester wrote: I've just released Module::Starter 0.02, meant as a replacement for h2xs. I think h2xs is very out of date as far as current best practices for modules. It's also very intimidating for people who just want to create a module, and have no need for all the compiler hoohah that h2xs throws at you. Module::Starter is meant to make things much eaiser. Attached is a patch with preliminary support for Module::Build support. I added a 'builder' option for specifing whether to use M::B or MakeMaker; default is still MakeMaker. I also added a 'license' option as M::B likes to have it and the next version of MakeMaker will also support it (for META.yml) although it is not in the current snapshot. One thing that may be desirable is to add options for Build.PL and Makefile.PL to co-exist, using one of Module::Build's compatability modes. Another addition would be to allow module-starter to write a module for an already created project. For example, if you create a project 'module-starter --module='Foo::Bar'', and later, you decide you need another module to add to the existing project. 'module-starter --module-only --module='Foo::Bar::Baz''. Randy. diff -urN Module-Starter-0.02-orig/Starter.pm Module-Starter-0.02/Starter.pm --- Module-Starter-0.02-orig/Starter.pm Sun Apr 4 23:32:12 2004 +++ Module-Starter-0.02/Starter.pm Mon Apr 5 19:44:32 2004 @@ -45,12 +45,15 @@ =item * $email +=item * $license + =back =cut our $verbose = 0; our $force = 0; +our $license = undef; our $author = Module Author; our $email = [EMAIL PROTECTED]; @@ -63,6 +66,7 @@ dir = $dirname, modules = [ module names ], distro = $distroname, +builder = 'Module::Build', # Defaults to ExtUtils::MakeMaker =cut @@ -78,6 +82,10 @@ die Must specify an author\n unless $author; die Must specify an email address\n unless $email; +unless ( defined($license) ) { +warn Defaulting to 'perl' license type\n; +$license = 'perl'; +} my $distro = $args{distro}; if ( not defined $distro ) { @@ -93,7 +101,13 @@ push @files, create_t( $basedir, @modules ); push @files, create_cvsignore( $basedir, $distro ); -push @files, create_Makefile_PL( $basedir, $distro, $modules[0] ); + +if ( $args{builder} eq 'Module::Build' ) { +push @files, create_Build_PL( $basedir, $distro, $modules[0] ); +} else { +push @files, create_Makefile_PL( $basedir, $distro, $modules[0] ); +} + push @files, create_Changes( $basedir, $distro ); push @files, MANIFEST; push @files, 'META.yml # Will be created by make dist'; @@ -172,7 +186,7 @@ my $module_file = File::Spec-catfile( @dirparts, $filepart ); open( my $fh, , $module_file ) or die Can't create $module_file: $!\n; -print $fh _module_guts( $module ); +print $fh _module_guts( $module ); close $fh; print Created $module_file\n if $verbose; @@ -301,6 +315,49 @@ print Created $fname\n if $verbose; return Makefile.PL; +} + +=head2 create_Build_PL( $basedir, $distro, $main_module ) + +Creates a Build.PL for the given module distro. + +=cut + +sub create_Build_PL { +my $basedir = shift; +my $distro = shift; +my $main_module = shift; + +my @parts = split( /::/, $main_module ); +my $pm = pop @parts; +my $main_pm_file = File::Spec-catfile( lib, @parts, ${pm}.pm ); + +my $fname = File::Spec-catfile( $basedir, Build.PL ); +open( my $fh, , $fname ) or die Can't create $fname: $!\n; + +print $fh HERE; +use strict; +use warnings; +use Module::Build; + +my \$builder = Module::Build-new( +module_name = '$main_module', +license = '$license', +dist_author = '$author $email', +dist_version_from = '$main_pm_file', +requires = { +'Test::More' = 0, +}, +add_to_cleanup = [ '$distro-*' ], +); + +\$builder-create_build_script(); +HERE + +close $fh; +print Created $fname\n if $verbose; + +return Build.PL; } =head2 create_Changes( $basedir, $distro ) diff -urN Module-Starter-0.02-orig/bin/module-starter Module-Starter-0.02/bin/module-starter --- Module-Starter-0.02-orig/bin/module-starter Sun Apr 4 23:17:02 2004 +++ Module-Starter-0.02/bin/module-starter Mon Apr 5 19:41:07 2004 @@ -15,21 +15,29 @@ my $distro; my $dir; +my $builder = 'ExtUtils::MakeMaker'; + GetOptions( distro=s = \$distro, module=s = [EMAIL PROTECTED], +builder=s = \$builder, author=s = \$Module::Starter::author, email=s =\$Module::Starter::email, +license=s = \$Module::Starter::license, force =\$Module::Starter::force, verbose = \$Module::Starter::verbose, version = sub { print module-starter v$Module::Starter::VERSION\n; exit 1; }, help = sub { pod2usage(1); }, ) or pod2usage(2); +pod2usage(2) unless ( $builder eq 'ExtUtils::MakeMaker' || +
Re: Module::Starter released
On Apr 5, 2004, at 3:18 PM, Mark Stosberg wrote: I think would useful to include ExtUtils::ModuleMaker in a SEE ALSO section, and explain the key differences. At first glance the projects seem quite similar. Yeah, I actually wonder whether the two projects could be merged somehow. Is Geoffrey responsive to emails about EU::ModuleMaker? -Ken
Re: How can I inform to CPAN system that TclTk-0.75 and Tcl-Tk-0.76 a re same module but different versions?
On Apr 5, 2004, at 2:41 AM, Konovalov, Vadim wrote: Could you please advice how can I inform to CPAN system that TclTk-0.75 and Tcl-Tk-0.76 are same module but different versions? The problem is seen here: http://search.cpan.org/~vkon/ The problem appears right after changing name in Makefile.PL It's not a problem with CPAN itself, it's only a viewing problem on search.cpan.org. You might drop a line to [EMAIL PROTECTED] if you want to try to fix it. I'm not sure what a suitable fix would be, though - the name of the distribution changed, so s.c.o thinks it's 2 different distributions. -Ken