Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

detailed html summary of failed tests

by blahblahblah (Priest)
on Feb 27, 2007 at 05:24 UTC ( [id://602256]=perlquestion: print w/replies, xml ) Need Help??

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

Hi,

We finally got around to migrating from our old dinosaur of a source code control system to subversion. I had a wrapper around the old system's "commit" command, which performed several tests on the to-be-committed changes. Rather than hack up my old, ugly, inconsistent wrapper to work with subversion, I'm rewriting it to be much cleaner and easier to expand and maintain. I'm also trying for the first time to learn about the standard Test modules.

I've read through much of chromatic's Perl Testing: A Developer's Notebook book, and have written a couple of working test scripts using Test::More. I'm pleasantly surprised by how easy it is so far, but I'm stuck on one point.

My old script was a command-line-only interface, and it would do each set of checks and then print instant, detailed feedback. It would show you the offending lines, explain what was wrong, and then either exit (for serious problems) or prompt you to continue (for minor warnings). I could tailor the output for each check to be as eye-catching and/or verbose as it needed to be. However, so far my experience with Test modules from CPAN is that it's hard to make the output very readable.

While writing my tests, I've used the diag() sub to print some details, but it's hard to differentiate it from the other output of the tests. Ideally I'd like to have these tests run either as a nightly job or as a post-commit hook in subversion, and I'd like the result to be a nice-looking html report containing the usual count of failed tests and also a detailed block of text for each failed test. I think that a "Harness" is what I want, but I haven't found anything like this.

Is this a reasonable thing to want to do? Is there a standard way in the test-anywhere-protocol to pass along a possibly-big block of formatted text detailing the failed tests?

Sorry that this is such a long post and the only question is in the previous sentence, but I have a feeling that I might be on the wrong track and I thought the background context might help. Please feel free to tell me that this is an X/Y problem -- I'm open to any suggestions.

Thanks,
Joe

Replies are listed 'Best First'.
Re: detailed html summary of failed tests
by Corion (Patriarch) on Feb 27, 2007 at 07:37 UTC
Re: detailed html summary of failed tests
by rhesa (Vicar) on Feb 27, 2007 at 12:19 UTC
    You might be interested in Smolder. Michael Peter's presentation (pdf) explains it in a nutshell.
Re: detailed html summary of failed tests
by adrianh (Chancellor) on Feb 27, 2007 at 12:25 UTC

    If you want something that somebody has already built, take a look at Test::TAP::HTMLMatrix.

    If you want to build your own test running I recommend you take a look at Ovid's TAPx::Parser, which can help you make your own test runners much more easily than messing with Test::Harness::Straps.

Re: detailed html summary of failed tests
by jesuashok (Curate) on Feb 27, 2007 at 07:57 UTC
    The Test modules are more intelligent to produce the required output you like. All_Test_Modules_From_Cpan

    A piece of adivce which you may require for your future perl developments. It is good that for all the modules you write during your work, should have a corresponding Test modules. This makes the life easy.
Re: detailed html summary of failed tests
by blahblahblah (Priest) on Feb 28, 2007 at 00:54 UTC
    Thanks for the pointers. I will definitely try these out.

    Joe

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://602256]
Approved by Mandrake
Front-paged by bobf
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-16 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found