Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Organize tests in sub-directories

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


orasnita at gmail

Nov 24, 2009, 12:31 PM

Post #1 of 6 (1231 views)
Permalink
Organize tests in sub-directories

Hello,

I would like to structure the t directory as lib/MyApp is structured. Is it
possible to be able to configure the app somehow so `make test` checks all
the test files even if they are in sub-directories?

`prove -r -l t` can do this, but it works well only under Linux or if I also
add the -j parameter and a big enough number of parallel jobs, so I'm not
sure it will always work.

Thanks.

Octavian


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


bobtfish at bobtfish

Nov 25, 2009, 2:00 AM

Post #2 of 6 (1160 views)
Permalink
Re: Organize tests in sub-directories [In reply to]

On 24 Nov 2009, at 20:31, Octavian Râşniţă wrote:
> I would like to structure the t directory as lib/MyApp is
> structured. Is it possible to be able to configure the app somehow
> so `make test` checks all the test files even if they are in sub-
> directories?

Yes, you just say something like:

tests 't/*.t', 't/*/*.t', 't/*/*/*.t'; # However many levels deep you
need

in Makefile.PL

Cheers
t0m



_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


orasnita at gmail

Nov 25, 2009, 4:36 AM

Post #3 of 6 (1152 views)
Permalink
Re: Organize tests in sub-directories [In reply to]

From: "Tomas Doran" <bobtfish [at] bobtfish>
On 24 Nov 2009, at 20:31, Octavian Râşniţă wrote:
> I would like to structure the t directory as lib/MyApp is structured. Is
> it possible to be able to configure the app somehow so `make test` checks
> all the test files even if they are in sub- directories?

Yes, you just say something like:

tests 't/*.t', 't/*/*.t', 't/*/*/*.t'; # However many levels deep you
need
in Makefile.PL


This is good news. But unfortunately it executes only the tests from the t
directory, not those from its subdirectories.

I have tried to put this line of code in more places in Makefile.PL with no
difference.

Thanks.

Octavian


_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


wallace at reis

Nov 25, 2009, 5:38 AM

Post #4 of 6 (1156 views)
Permalink
Re: Organize tests in sub-directories [In reply to]

On 25/11/2009, at 09:36, Octavian Râşniţă wrote:
> This is good news. But unfortunately it executes only the tests from the t directory, not those from its subdirectories.
>
> I have tried to put this line of code in more places in Makefile.PL with no difference.


You can use tests_recursive from Module::Install::Makefile.

--
wallace reis/wreis Catalyst and DBIx::Class consultancy with a clue
Software Engineer and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
http://www.shadowcat.co.uk http://www.linkedin.com/in/wallacereis
_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


orasnita at gmail

Nov 25, 2009, 8:57 AM

Post #5 of 6 (1143 views)
Permalink
Re: Organize tests in sub-directories [In reply to]

From: "Wallace Reis" <wallace [at] reis>

On 25/11/2009, at 09:36, Octavian Râşniţă wrote:
> This is good news. But unfortunately it executes only the tests from the t
> directory, not those from its subdirectories.
>
> I have tried to put this line of code in more places in Makefile.PL with
> no difference.


You can use tests_recursive from Module::Install::Makefile.


Great! It works fine that way.

With this ocasion I've seen that the correct way of using tests() is not:

tests 't/*.t', 't/*/*.t', 't/*/*/*.t', 't/*/*/*/*.t', 't/*/*/*/*/*.t';

but probably

tests 't/*.t, */*.t';

(including all the file specifications in a single string)

Octavian



_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/


catalyst at iandocherty

Nov 26, 2009, 12:12 AM

Post #6 of 6 (1118 views)
Permalink
Re: Organize tests in sub-directories [In reply to]

Tomas Doran wrote:
>
> On 24 Nov 2009, at 20:31, Octavian Râşniţă wrote:
>> I would like to structure the t directory as lib/MyApp is structured.
>> Is it possible to be able to configure the app somehow so `make test`
>> checks all the test files even if they are in sub-directories?
>
> Yes, you just say something like:
>
> tests 't/*.t', 't/*/*.t', 't/*/*/*.t'; # However many levels deep you need

Isn't it safer and simpler to use

tests recursive

in Makefile.PL rather than risk missing a level if at some point you add
another level and you forget to update the Makefile.PL?

>
> in Makefile.PL
>
> Cheers
> t0m

Regards
Ian

_______________________________________________
List: Catalyst [at] lists
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.