Hi monks,
I need to Generate HTML reports from unit test results, for the xml there is a module Test::Unit::Runner::XML it's generate xml reports from unit test results. Likethese, i need to genarate html reports from unit test results if any ideas. Give me the sample code or links..
I don't know what kind of XML Test::Unit::Runner produces, but for the output that all the Perl test modules produce, there is Test::TAP::HTMLMatrix, which produces nice output - searching for HTMLMatrix pugs gives some examples.
If you have to use the output of Test::Unit::Runner::XML then applying some XSLT would seem the simplest solution.
If you don't then using the Test::Unit::HarnessUnit test running which outputs TAP. You can then feed this into Test::TAP::HTMLMatrix to get pretty HTML results.
T:U:Runner::XML was discussed, Andrew said it "reports in the format used by JUnit, to allow Test::Unit to work with continuous integration systems such as CruiseControl and damagecontrol".
I guessed that XSL exists already but I haven't investigated that far. Sorry, named the wrong project in my earlier mail (which the SF archive hasn't picked up yet).
-- mca1001 of users dot sf ...
Thanks for supporting the opposition, Adrian. 8-)
You're welcome! However, I don't see Test::Unit as competition - and I don't mean that in a nasty way :-)
The Test::Unit philosophy is just different from Test::Class's. Not worse. For those with any experience of JUnit it's easier to adopt than having to understand Perl's TAP / Test::Harness / Test::Builder / Test::Class approach to xUnit style testing.
In some ways its better - for example it's far easier to make a new test runner with Test::Unit than it is to build something with Test::Harness::Straps. In some ways its worse - for example not being able to take advantage of the many Test::Builder based modules on CPAN. Pick whichever makes your life easier I say!
(Although I think it interesting that the latest JUnit and TestNG are, in some ways, closer to Test::Harness/Test::Class than Perl's Test::Unit with the use of attributes, adopting multiple setup/teardown methods, etc. I'd be interested to see whether Test::Unit starts adopting some of the features seen in the latest JUnit.)
T:U:Runner::XML was discussed, Andrew said it "reports in the format used by JUnit, to allow Test::Unit to work with continuous integration systems such as CruiseControl and damagecontrol".
It's the same output as Ant's JUnit task - poking around http://ant.apache.org might turn up something useful.
perlmonks.org content © perlmonks.org and adrianh, Anonymous Monk, Corion, friedo, gube
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03