On Tue, Mar 22, 2005 at 02:12:58PM +1100, Andrew Savige wrote:
> > You use globbing instead of spelling each test out on the command line.
> > That's a Module::Install/autrijusism.
> > 
> > If you want to see how MakeMaker specifically deals with it see
> > test_harness() in
> >
> http://search.cpan.org/src/MSCHWERN/ExtUtils-MakeMaker-6.25_12/lib/ExtUtils/Command/MM.pm
> 
> Lucky for Pugs it's an "autrijusism". :-) I can't see a trivial way to get
> Module::Install to do it, then again I've not used Module::Install before.
> 
> All I can think of, and this is just a guess, is to somehow hack the
> new 6.25_12 MakeMaker test_harness()/expand_wildcards() functionality
> into:
> 
> ext/Pugs-MakeMaker/libs/Pugs/MakeMaker.pm

pugs doesn't appear to be using Pugs::MakeMaker to install itself.  Its
using Module::Install.  Pugs::MakeMaker is to install pugs modules.
So fix Module::Install and you've fixed pugs.

ExtUtils::AutoInstall::_make_args() is the culprit.  It starts out with
t/*.t but then expands them all in case any of them are disabled.
Well, a stopgap solution is to avoid expanding TESTS where possible.
Namely, if there's no disabled tests don't expand.
See https://rt.cpan.org/NoAuth/Bug.html?id=11960 for the patch.

Well, that'll fix Module::Install for most people.  pugs appears to
be doing something mutant.  Its pre-expanding the globs in its Makefile.PL
for no real reason.

makemaker_args  (
    test => { TESTS => join ' ', (glob("t/*.t"), glob("t/*/*.t")) },
    MAN1PODS => {},
);

MakeMaker is quite capable of expanding the globs for you.

--- old-pugs/Makefile.PL        2005-03-21 19:45:40.000000000 -0800
+++ new-pugs/Makefile.PL        2005-03-21 20:16:08.000000000 -0800
@@ -29,7 +29,7 @@
 include         ('Module::Install::Makefile::Version');
 build_subdirs   (map fixpaths($_), grep -e "$_/Makefile.PL", glob("ext/*"));
 makemaker_args  (
-    test => { TESTS => join ' ', (glob("t/*.t"), glob("t/*/*.t")) },
+    test => { TESTS => "t/*.t t/*/*.t" },
     MAN1PODS => {},
 );
 clean_files     (map fixpaths($_),


Looking at Pugs::MakeMaker...

For starters, test_via_harness (the thing which writes out the test target)
is overridable as a method.  So a lot of this s/// over the Makefile is
unnecessary.  You can just override the test_via_harness() directly.
Module::Install does the same thing, it does a s/// when it could just be
overriding test_via_harness().

I'll look further into it later, maybe.

Reply via email to