Opened 10 years ago

Last modified 6 years ago

#7417 new Patches

Detailed test status is not available in the Boost.Test log (status, assertions, passed) and so live test case status cannot be tracked

Reported by: Jamie Allsop <ja11sop@…> Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Currently with Boost.Test it is not possible to use the test output to show detailed live test progress. By detailed I mean, test status, number of passed assertions and total number of assertions. This is because:

  1. Only basic status information is provided through stdout (the Boost.Test log) as tests are proceeding. Notably just whether a test has started or a test has finished.
  2. Detailed information is accessible by accessing the test report information captured as part of the Boost.Test report functionality which is typical sent to stderr.
  3. Report data is only output when all tests are complete therefore this information cannot be used for live reporting. In other words a solution is not to listen on both stdout and stderr

The attached patch adds additional test status information to the information sent to stdout - the Boost.Test log. This allows arbitrary test tools to be developed that interpret the test output for live test progress reporting.

We use one such tool based on scons that allows us to view live test progress on the console. This is not possible with the current Boost.Test since detailed test status is not available until all cases have completed.

This patch compliments the patches attached to:

#7397
Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class
#7410
Test Units (Cases and Suites) in Boost.Test do not capture __FILE__ and __LINE__ at declaration point making it impossible to provide source file linking using external test management tools

and taken together allows for sophisticated test tools to be built on top of the Boost.Test output.

Attachments (1)

boost_test_detailed_status_to_stdout.diff (2.7 KB ) - added by Jamie Allsop <ja11sop@…> 10 years ago.

Download all attachments as: .zip

Change History (3)

by Jamie Allsop <ja11sop@…>, 10 years ago

comment:1 by Jamie Allsop <ja11sop@…>, 10 years ago

Summary: It is not possible toDetailed test status is not available in the Boost.Test log (status, assertions, passed) and so live test case status cannot be tracked

comment:2 by Raffi Enficiaud, 6 years ago

Since Boost 1.62, there is the possibility to define a user logger and add it to the set of loggers (and have several loggers at the same time).

I updated the documentation of the loggers to a point that you should be able to implement your live test cases. I use this for being able to write JUnit logging output, which is a logger and a reporting facility at the same time.

I believe you can derive your own logger from the JUnit implementation. The test reporter and test loggers have indeed the same interface, and they both receive the same signals from the framework. There is also the possibility to have detailed logs during the test module execution.

I would rather suggest go this direction, you can have my support if needed.

Note: See TracTickets for help on using tickets.