develooper Front page | perl.qa | Postings from October 2007

Re: getting better harness output with Test::Class

From:
Tom Heady
Date:
October 26, 2007 13:05
Subject:
Re: getting better harness output with Test::Class
The problem that I was mentioning is having to explicitly call each 
class in a separate file.  The method below keeps that from happening. 
I assumed you were talking about programmer efficiency. (DRY)

The method does require a single file per class, and loading perl for 
each of those files.  If you are trying to avoid that it's not going to 
help.

Jonathan Swartz wrote:
> So this is a single file? And when you say you are getting around the 
> problem, you mean having to define a whole other script per class? 
> Because it still looks like you have to launch Perl and load your 
> modules for every test class.
> 
> On Oct 26, 2007, at 10:39 AM, Tom Heady wrote:
> 
>> Jonathan Swartz wrote:
>>> ...
>>> I'd like to avoid actually running a single script per class, for 
>>> efficiency reasons - i.e. I agree with Ovid and Adrian here:
>>>     http://use.perl.org/~Ovid/journal/31172
>>> ...
>>
>>
>> I get around the problem described in that post thusly:
>>
>> foo.t:
>> ------
>> #!/usr/bin/perl
>>
>> foo::Test->Runtests;
>>
>> 1;
>>
>> package foo::Test;
>>
>> use base 'Test::Class';
>>
>> is ( $dog , $cat , 'does dog eq cat?' );
>>
>> 1;
>>
>> --------------------
>> Tom
> 




Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About