Test::Unit and logging

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.

On Jul 24, 2006, at 6:55 PM, [email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs