Perl - Test::Unit::Lite, how to use multiple folders for test files
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 i开发者_开发知识库gnores them.
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.
精彩评论