ExtUtils::MakeMaker, and t/ sub-directories
[ 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
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
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
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
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
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
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
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
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
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