Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
No such thing as a small change
 
PerlMonks  

Generate HTML reports from unit test results

by gube (Parson)
on May 02, 2006 at 03:13 UTC ( [id://546833]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

gube has asked for the wisdom of the Perl Monks concerning the following question:

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..

  • Comment on Generate HTML reports from unit test results

Replies are listed 'Best First'.
Re: Generate HTML reports from unit test results
by Corion (Patriarch) on May 02, 2006 at 03:17 UTC
Re: Generate HTML reports from unit test results
by friedo (Prior) on May 02, 2006 at 06:27 UTC
    You might be interested in mpeters' project, Smolder, which does some really spiffy reports for unit tests.
Re: Generate HTML reports from unit test results
by adrianh (Chancellor) on May 02, 2006 at 06:50 UTC

    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.

      Thanks for supporting the opposition, Adrian. 8-)

      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.

Re: Generate HTML reports from unit test results
by gube (Parson) on May 02, 2006 at 07:54 UTC

    Hi adrianh and all,
    Thanks for your suggestion and comments.
    Regards,
    Gube

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://546833]
Approved by Corion
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.