Matisse Enzer wrote:
> A side-note to keep in mind: If we every want to be able to convert TAP
> to the XML format produced by the JUnit ant task (this way for example
> CruiseControl could more easily read the results of Perl tests) then it
> becomes desirable to get timing info for each perl test - that is, each 
> ok(), is(), is_deeply(), etc.
> 
> I created a toy version of a converter script:
>  
> http://twoalpha.blogspot.com/2007/01/junit-style-xml-from-perl-test-files.html
> 
> and it just puts 0 in the spot where JUnit normally puts a time.

Is this a time stamp or the elapsed time for a test?  The former is pretty
easy, just add to Test::Builder::ok().  The latter is not.  Perl tests don't
have any clearly defined start or end for a given test like JUnit does.  For
example...

        is( some_function(42), 23 );

When does the test start?  Probably when some_function() is called.  But
that's called *before* is() is called.  All is() can time is it's own run time
and that's not very interesting.

Unless you're using Test::Class, but even that can have multiple tests per 
method.

Best thing you can do is track the time between tests, which you can do at the
TAP parser level.  You can do it with Straps, but its easier to do it with
TAP::Parser.


-- 
Whip me, beat me, make my code compatible with VMS!

Reply via email to