Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-09 Thread Ricardo SIGNES
* Adam Kennedy [EMAIL PROTECTED] [2007-02-08T19:17:39]
 
 Yep, although M::I has some capacity to add a but of extra magic if you 
 could come up with a workaround (like having File::Find locate them all 
 and provide a complete list of TESTS).

I do this in http://search.cpan.org/src/RJBS/Rubric-0.142/Makefile.PL

The annoyance for me is that EUMM's normal behavior means that if I add .t
files to ./t/, they get run the next time I make test, because they're globbed
then.  With the M::I trick, they aren't run unless I regenerate the Makefile.

I've never been annoyed enough by this to do anything about it, though.

-- 
rjbs


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-09 Thread demerphq

On 2/8/07, Christopher H. Laco [EMAIL PROTECTED] wrote:

Nik Clayton wrote:
 Paul Johnson wrote:
 On Thu, Feb 08, 2007 at 09:26:01AM +, Nik Clayton wrote:

 [ I vaguely recall a discussion about this, but my search-fu is weak,
 and I can't find it ]

 Is there a standard way/idiom to get ExtUtils::MakeMaker to support
 tests in subdirectories of t/?

 I've got a bunch of tests, and rather than client-ls.t, client-add.t,
 client-commit.t, etc, I'd like t/client/ls.t, t/client/add.t,
 t/client/commit.t, and so on.

 I have this in one of my Makefile.PLs, which seems to be just about
 what you
 are looking for:

 WriteMakefile
 (
 ...
 test = { TESTS = t/*/*.t },
 ...
 );

 Ah.  My mistake for not being clear enough.  I want to run t/*.t and
 t/*/*.t.

 Of course, I tried

   test = { TESTS = [ t/*.t, t/*/*.t ] },

 and it doesn't work.  It's just occurred to me that I'm trying to be too
 clever.

   test = { TESTS = t/*.t t/*/*.t },

 works perfectly.

 N



I offer this word of warning. If you have too many tests, or many
longly-named tests, win32 will in all likelyhood barf with a command
line too long error.


I think this is a legitimate issue to consider. What particular
sequence of events leads to this happening and how can we address it.

The other thing that comes to mind is making the tree too deep, such
that on win32 you exceed the maximum path length.

I guess other platforms have similar but different zaps and traps to
consider as well.

cheers,
Yves


--
perl -Mre=debug -e /just|another|perl|hacker/


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-09 Thread Michael G Schwern
Christopher H. Laco wrote:
 I offer this word of warning. If you have too many tests, or many
 longly-named tests, win32 will in all likelyhood barf with a command
 line too long error.

 I had this problem in Handel (too many tests..it's a good problem to
 have really), and even after updating EU::MM and all of my other Test::
 bits, I still had the problems.

/me looks at the bug tracker.
/me fails to find a report.
/me goes back to bed.

Got anything a bit more repeatable so it can be fixed?

Actually, I see the problem.

test  = { TESTS = join ' ', (glob(t/*.t)) }

Handel is pre-expanding the glob, not MM.  That's why all the updating in the 
world wouldn't fix it.


 Some people do. Some people don't. It seems to be a crapshoot. But the
 only consistant fix for me was to keep all of my tests in t/, and to not
 use the test = {TESTS} idium

The TESTS = t/*.t t/*/*.t idiom should be safe in modern MakeMakers as it 
*does not expand the glob* before handing the command off to the shell.  That 
was the old behvior.  Now it does the glob expansion itself once its already 
inside ExtUtils::Command::MM::test_harness().

This was fixed about two years ago.

6.25_01  Fri Dec 17 21:29:04 EST 2004
- 'make test' on Windows no longer pre-expands its list of test files.
  This caused problems on large distributions like bioperl.  Thanks to
  Tim Bunce for suggesting the obvious fix.


 I also had the same issue when using M::I w/Makefile.PL, which is just
 EU::MM underneath I assume.

MI violates MM's encapsulation (such as it is) with various squealing farm 
animals all the live long day.  So no, MI is not just MM underneath.  One of 
the things it does is pre-expand the test glob.


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-09 Thread Michael G Schwern
Maybe somebody would like to, ya know, provide a patch for an open ticket or 
something?
http://rt.cpan.org/Public/Bug/Display.html?id=22767



ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Nik Clayton
[ I vaguely recall a discussion about this, but my search-fu is weak, and I 
can't find it ]


Is there a standard way/idiom to get ExtUtils::MakeMaker to support tests in 
subdirectories of t/?


I've got a bunch of tests, and rather than client-ls.t, client-add.t, 
client-commit.t, etc, I'd like t/client/ls.t, t/client/add.t, 
t/client/commit.t, and so on.


N


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Paul Johnson
On Thu, Feb 08, 2007 at 09:26:01AM +, Nik Clayton wrote:

 [ I vaguely recall a discussion about this, but my search-fu is weak, and I 
 can't find it ]
 
 Is there a standard way/idiom to get ExtUtils::MakeMaker to support tests 
 in subdirectories of t/?
 
 I've got a bunch of tests, and rather than client-ls.t, client-add.t, 
 client-commit.t, etc, I'd like t/client/ls.t, t/client/add.t, 
 t/client/commit.t, and so on.

I have this in one of my Makefile.PLs, which seems to be just about what you
are looking for:

WriteMakefile
(
...
test = { TESTS = t/*/*.t },
...
);

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Nik Clayton

Paul Johnson wrote:

On Thu, Feb 08, 2007 at 09:26:01AM +, Nik Clayton wrote:

[ I vaguely recall a discussion about this, but my search-fu is weak, and I 
can't find it ]


Is there a standard way/idiom to get ExtUtils::MakeMaker to support tests 
in subdirectories of t/?


I've got a bunch of tests, and rather than client-ls.t, client-add.t, 
client-commit.t, etc, I'd like t/client/ls.t, t/client/add.t, 
t/client/commit.t, and so on.


I have this in one of my Makefile.PLs, which seems to be just about what you
are looking for:

WriteMakefile
(
...
test = { TESTS = t/*/*.t },
...
);


Ah.  My mistake for not being clear enough.  I want to run t/*.t and t/*/*.t.

Of course, I tried

  test = { TESTS = [ t/*.t, t/*/*.t ] },

and it doesn't work.  It's just occurred to me that I'm trying to be too clever.

  test = { TESTS = t/*.t t/*/*.t },

works perfectly.

N


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Christopher H. Laco
Nik Clayton wrote:
 Paul Johnson wrote:
 On Thu, Feb 08, 2007 at 09:26:01AM +, Nik Clayton wrote:

 [ I vaguely recall a discussion about this, but my search-fu is weak,
 and I can't find it ]

 Is there a standard way/idiom to get ExtUtils::MakeMaker to support
 tests in subdirectories of t/?

 I've got a bunch of tests, and rather than client-ls.t, client-add.t,
 client-commit.t, etc, I'd like t/client/ls.t, t/client/add.t,
 t/client/commit.t, and so on.

 I have this in one of my Makefile.PLs, which seems to be just about
 what you
 are looking for:

 WriteMakefile
 (
 ...
 test = { TESTS = t/*/*.t },
 ...
 );
 
 Ah.  My mistake for not being clear enough.  I want to run t/*.t and
 t/*/*.t.
 
 Of course, I tried
 
   test = { TESTS = [ t/*.t, t/*/*.t ] },
 
 and it doesn't work.  It's just occurred to me that I'm trying to be too
 clever.
 
   test = { TESTS = t/*.t t/*/*.t },
 
 works perfectly.
 
 N
 
 

I offer this word of warning. If you have too many tests, or many
longly-named tests, win32 will in all likelyhood barf with a command
line too long error.

I had this problem in Handel (too many tests..it's a good problem to
have really), and even after updating EU::MM and all of my other Test::
bits, I still had the problems.

Some people do. Some people don't. It seems to be a crapshoot. But the
only consistant fix for me was to keep all of my tests in t/, and to not
use the test = {TESTS} idium

I also had the same issue when using M::I w/Makefile.PL, which is just
EU::MM underneath I assume.

-=Chris



signature.asc
Description: OpenPGP digital signature


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Andy Lester


On Feb 8, 2007, at 1:26 AM, Nik Clayton wrote:

[ I vaguely recall a discussion about this, but my search-fu is  
weak, and I can't find it ]


Is there a standard way/idiom to get ExtUtils::MakeMaker to support  
tests in subdirectories of t/?


I've got a bunch of tests, and rather than client-ls.t, client- 
add.t, client-commit.t, etc, I'd like t/client/ls.t, t/client/ 
add.t, t/client/commit.t, and so on.


No, there's not a way for MakeMaker to do it.  Look at how I handle  
it in WWW::Mechanize, where I have t/live, t/static, etc.


--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Andy Lester


On Feb 8, 2007, at 1:26 AM, Nik Clayton wrote:

[ I vaguely recall a discussion about this, but my search-fu is  
weak, and I can't find it ]


Is there a standard way/idiom to get ExtUtils::MakeMaker to support  
tests in subdirectories of t/?


I've got a bunch of tests, and rather than client-ls.t, client- 
add.t, client-commit.t, etc, I'd like t/client/ls.t, t/client/ 
add.t, t/client/commit.t, and so on.


No, there's not a way for MakeMaker to do it.  Look at how I handle  
it in WWW::Mechanize, where I have t/live, t/static, etc.


--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread brian d foy
In article [EMAIL PROTECTED], Andy
Lester [EMAIL PROTECTED] wrote:

 On Feb 8, 2007, at 1:26 AM, Nik Clayton wrote:
 
  [ I vaguely recall a discussion about this, but my search-fu is  
  weak, and I can't find it ]
 
  Is there a standard way/idiom to get ExtUtils::MakeMaker to support  
  tests in subdirectories of t/?
 
  I've got a bunch of tests, and rather than client-ls.t, client- 
  add.t, client-commit.t, etc, I'd like t/client/ls.t, t/client/ 
  add.t, t/client/commit.t, and so on.
 
 No, there's not a way for MakeMaker to do it.  Look at how I handle  
 it in WWW::Mechanize, where I have t/live, t/static, etc.

Sure there's a way to get MakeMaker to do it. You just have to tell it
how to find the test files, as I do in Test::Manifest.


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread brian d foy
In article [EMAIL PROTECTED], Nik
Clayton [EMAIL PROTECTED] wrote:


 Is there a standard way/idiom to get ExtUtils::MakeMaker to support tests in 
 subdirectories of t/?

I don't know of a standard idiom, but I created Test::Manifest so I
didn't have to live with MakeMaker's method of getting test files,
which is just globbing t/. IF you don't like the way that I do it in
Test::Manifest, just follow the example to override the parts that
discover the test files. 

Although Andy says that MakeMaker can't do it, MakeMaker has a built-in
extension mechanism with the MY::* namespace to override parts of
itself.


Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Andy Lester


Although Andy says that MakeMaker can't do it, MakeMaker has a  
built-in

extension mechanism with the MY::* namespace to override parts of
itself.


True enough.  I have standard extensions of MY::postamble in all my  
Makefile.PLs so that I have targets for tags and critic.


sub MY::postamble {
my $postamble = 'MAKE_FRAG';
.PHONY: tags critic

tags:
ctags -f tags --recurse --totals \
--exclude=blib \
--exclude=.svn \
--exclude='*~' \
--languages=Perl --langmap=Perl:+.t \

critic:
perlcritic -1 -q -profile perlcriticrc bin/ lib/ t/
MAKE_FRAG

return $postamble;
}

--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Re: ExtUtils::MakeMaker, and t/ sub-directories

2007-02-08 Thread Adam Kennedy

Christopher H. Laco wrote:

Nik Clayton wrote:

Paul Johnson wrote:

On Thu, Feb 08, 2007 at 09:26:01AM +, Nik Clayton wrote:


[ I vaguely recall a discussion about this, but my search-fu is weak,
and I can't find it ]

Is there a standard way/idiom to get ExtUtils::MakeMaker to support
tests in subdirectories of t/?

I've got a bunch of tests, and rather than client-ls.t, client-add.t,
client-commit.t, etc, I'd like t/client/ls.t, t/client/add.t,
t/client/commit.t, and so on.

I have this in one of my Makefile.PLs, which seems to be just about
what you
are looking for:

WriteMakefile
(
...
test = { TESTS = t/*/*.t },
...
);

Ah.  My mistake for not being clear enough.  I want to run t/*.t and
t/*/*.t.

Of course, I tried

  test = { TESTS = [ t/*.t, t/*/*.t ] },

and it doesn't work.  It's just occurred to me that I'm trying to be too
clever.

  test = { TESTS = t/*.t t/*/*.t },

works perfectly.

N




I offer this word of warning. If you have too many tests, or many
longly-named tests, win32 will in all likelyhood barf with a command
line too long error.

I had this problem in Handel (too many tests..it's a good problem to
have really), and even after updating EU::MM and all of my other Test::
bits, I still had the problems.

Some people do. Some people don't. It seems to be a crapshoot. But the
only consistant fix for me was to keep all of my tests in t/, and to not
use the test = {TESTS} idium

I also had the same issue when using M::I w/Makefile.PL, which is just
EU::MM underneath I assume.


Yep, although M::I has some capacity to add a but of extra magic if you 
could come up with a workaround (like having File::Find locate them all 
and provide a complete list of TESTS).


Adam K