Ovid wrote:
> Hi all,
> 
> This is probaby a weird request and it's something I could use, but not 
> everyone will.  Further, it might require that Test::Harness be changed and I 
> don't know if this is likely or reasonable.
> 
> Basically, when I run a single test, I do something like this:
> 
>   prove t/test_name.t
> 
> However, if I'm using Test::Class, I do something like this:
> 
>   prove t/test_class_tests.t
> 
> Typically, Test::Class tests have a wrapper script which loads the classes 
> and runs the tests.  However, I have a different wrapper script 
> (http://use.perl.org/~Ovid/journal/30510) which allows me to do this:

Actually, the way I use Test::Class is to have one script per class. That way I
can just run one if I want to.

>   perl t/test_class_tests.t path/to/test/class.pm
> 
> Instead of loading all classes, it merely loads the one class I want to test. 
>  This is handy when I'm working on a single class and I don't want to run all 
> 4,000 friggin' tests.
> 
> What I would prefer to do is something like this:
> 
>   prove t/test_class_tests.t path/to/test/class.pm
> 
> I want to do that so I can use Test::Harness, but the path is considered an 
> argument to prove and not my Test::Class driver wrapper script.
> 
> From what I can tell, Test::Harness doesn't support anything like this 
> directly and naturally prove doesn't either.  Can anyone make any 
> recommendations on a good approach here?  My ideas are terrible things like 
> setting environment variables and other things I would simply prefer to avoid.

Test::Harness doesn't need to support this. I'm pretty sure that you can just
make your modules runnable from the command line.

http://www.perl.com/pub/a/2006/07/13/lightning-articles.html?page=4

-- 
Michael Peters
Developer
Plus Three, LP

Reply via email to