Boost logo

Boost Users :

Subject: [Boost-users] [Test] How to log output to both stdout in HRF and to a file in XML?
From: Martin Ba (0xcdcdcdcd_at_[hidden])
Date: 2014-10-22 06:23:15


As asked on SO:
http://stackoverflow.com/questions/26505229/how-to-log-boost-test-output-to-both-stdout-in-hrf-and-to-a-file-in-xml

I would like to enable logging of Boost.Test output to *both* the
stdout/sterr and to a logfile.

However, I would also like to have the stdout logging be in
HumanReadableFormat and only the file output be in XML format.

Generating a report file seems to be addressed [here][1]. ([official
docs][2])

Choosing the format can be done in [various ways][3], but it seems one
is stuck with either HRF or XML?

-----------
Rationale:

When running tests on or [Jenkins][4] server, the [xUnit plugin][5]
[requires][6] the **log** XML output (as opposed to the *report* XML
output -- `log_level` vs. `report_level`).

However, the in-progress log output (in HRF) is highly valuable *while*
the tests are running on the server, to detect hanging tests or to a
quick manual check of where the tests currently are. So I want an
in-progress HRF log for the tests and at the end I need an XML file
containing the `<TestLog>...</TestLog>` output of Boost.Test (not the
`<TestResult>` output).

Do note that we run both unit as well as integration tests via
Boost.Test, so some of them are quite long-running.

   [1]:
http://stackoverflow.com/questions/3786639/what-is-the-better-way-to-generate-test-report-in-a-file-using-boost-test
   [2]:
http://www.boost.org/doc/libs/1_44_0/libs/test/doc/html/utf/user-guide/test-output/log-ct-config.html
   [3]:
http://www.boost.org/doc/libs/1_44_0/libs/test/doc/html/utf/user-guide/runtime-config/reference.html
   [4]: http://jenkins-ci.org/
   [5]: https://wiki.jenkins-ci.org/display/JENKINS/xUnit+Plugin
   [6]: https://issues.jenkins-ci.org/browse/JENKINS-13686


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