Test::Unit and logging

L

listrecv

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

Mat Schaffer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,250
Latest member
Charlesreero

Latest Threads

Top