views:

17

answers:

1

I use Test::Unit::Lite for unit testing in Perl. Now, this module looks for .pm files in t/tlib. However, I have several tests for the project and I would like to separate them in folders like: t/tlib/Unit_Tests/...pm, t/tlib/Functional_Tests/...pm and so on.

How can I tell to the unit test module to look for files in subdirectories of t/tlib. Right now, if I make some directories there, it just ignores them.

A: 

So ... I found out the answer ... In the .pm testfiles in the subdirectories you have to name the package accordingly.

For example:

Folder: t/tlib/Unit
File: t/tlib/Unit/MyTest.pm

MyTest.pm must contain:
package Unit::MyTest.pm

Note the "Unit::" part, which is the subdirectory name where your test is.

Patkos Csaba