Boost logo

Boost Users :

Subject: [Boost-users] Integrating Boost::Test into a logger
From: Charles Solar (redcomet87_at_[hidden])
Date: 2010-01-24 17:08:40


I am wondering if its possible to integrate boost::test into my logging
system so I can segregate the log messages into the individual tests. Right
now I have the results redirecting to a file, but all I get is 'this
succeeded, this failed' and there is no way to go into my apps log file and
tie the failed tests to the log messages.
I was wondering if there is some mechanism I can write up that will allow me
to log the test name at the beginning and end of the test so I end up with
output like:

LOG_INFO: Starting test 'zero_length_string_test'
LOG_ERROR: String is zero length!
LOG_WARN: Could not create new string
LOG_INFO: End test 'zero_length_string_test'

Then when I go to my results I can do a quick search of my apps log to find
out why something failed.

So is there someway to get a hold of the current test name in a fixture, or
is there someway to setup a global fixture that is executed for each test
and has this information?

Thanks



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net