On Sunday 04 March 2007, chromatic wrote:
> On Saturday 03 March 2007 18:18, Andy Lester wrote:
> > Good Lord do I get frustrated at the handwringing over test  
> > counting.  Look, it's simple.  You write your tests.  You run it  
> > through prove.  You see how many tests it reports.  You add it at the  
> > top of the file.  Voila!
>
> But Andy, what if I modify the test file?  I don't want to have to modify
> the test file to tell my test harness that I've modified the test file!
>
> If only we had something that flies through space....
>

My solution to this is:

http://search.cpan.org/dist/Test-Count/

It's not a perfect solution but it Works For Me.<tm>

What I do is add comments in a small domain-specific language that allow me to 
count how many tests were added. These comments are usually placed close to 
the tests themselves, so they can be updated at the same time. Examples for 
such comments are:

# TEST
is ($mystring, "Hello", "String is Hello");

# TEST*3
for my $i (0 .. 2)
{
        ok (....)
}

Regards,

        Shlomi Fish

---------------------------------------------------------------------
Shlomi Fish      [EMAIL PROTECTED]
Homepage:        http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.

Reply via email to