On 5 Oct 2007, at 13:50, Mark Fowler wrote:
I would like to press a key shortcut in my text editor and have it
run the test I'm currently editing. If there are any failures, I'd
like to be able to click on them and it go to the line that the
failing test was on. Since my current editor is TextMate this
involves creating a script that runs my test and outputs HTML.
Ooh. I'm a TextMate user and I'd like that too :)
I assume that I want to use TAP::Parser for this. The interface
for the version on CPAN seems clean, but how do I work out what
line the failing test was on? Is there an existing module that
does this (or can I do it with TAP::Parser somehow?)
The TAP output from tests doesn't currently capture the failure line
number. So TAP::Parser simply doesn't know and can't give you that
information.
We have support now for YAML diagnostic blocks which will allow all
sorts of interesting metadata to be associated with each result:
http://testanything.org/wiki/index.php/TAP_diagnostic_syntax
As you can see that'll capture cool stuff like the line number - and
more.
To get it working right now you'd need to roll a new version of
Test::More that outputs the YAML diagnostics. If you had that I
believe everything else is in place - it'd be a 10 liner to analyse
the TAP and generate a report TextMate could grok.
Oh and if you're doing any other cool Perl stuff with TM let me know :)
--
Andy Armstrong, Hexten