[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Test::Unit and logging

List Recv

7/24/2006 10:53:00 PM

Is there a simple way to have Test::Unit use Log4r (or Logger) to add a
log message whenever a test fails?

My first step in debugging is to look at the logs. But, with copious
logs, it's hard to find the case which failed. It would be great if I
could just search the log for the message of the test failing.

1 Answer

Mat Schaffer

7/25/2006 12:41:00 PM

0


On Jul 24, 2006, at 6:55 PM, listrecv@gmail.com wrote:

> Is there a simple way to have Test::Unit use Log4r (or Logger) to
> add a
> log message whenever a test fails?
>
> My first step in debugging is to look at the logs. But, with copious
> logs, it's hard to find the case which failed. It would be great if I
> could just search the log for the message of the test failing.

I'm no expert here, but since your question still doesn't have a
reply...

Have you looked into the various continuous integration solutions.
You'll need some googling, but they're designed to run tests
regularly against a repository and do things like send emails when a
test fails. They may be configurable to log as well.

Finally, I'd dig into the code for Test::Unit::TestCase to find how
it displays failures. There might be a function you can over-ride or
replace easily enough to create the log messages you're looking for.
-Mat