[Boost-bugs] [Boost C++ Libraries] #5008: Boost.Test does not do checkpointing of entry/exit of test cases

Subject: [Boost-bugs] [Boost C++ Libraries] #5008: Boost.Test does not do checkpointing of entry/exit of test cases
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-21 14:17:11


#5008: Boost.Test does not do checkpointing of entry/exit of test cases
------------------------------------------------------+---------------------
 Reporter: Peter Soetens <peter@…> | Owner: rogeeff
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
------------------------------------------------------+---------------------
 I'm using boost 1.40. When '''parsing''' the output of a Boost.Test xml
 file, I sometimes get this error:

 "test-result.xml:cvc-complex-type.2.4.b: The content of element
 'Exception' is not complete. One of '{LastCheckpoint}' is expected."
 (output from Hudson Test plugin).

 It appears that Boost.Test does not consider the entry point of the unit
 test function as a checkpoint, while the documentation says it does[1]. I
 can 'fix' this by inserting check/pass points at the beginning of every
 function, but shouldn't Boost.Test do this automatically ?

 Test case:

 struct A {};

 BOOST_FIXTURE_TEST_SUITE( TestSuite, A )
 BOOST_AUTO_TEST_CASE(testThrow)
 {
     throw A();
 }
 BOOST_AUTO_TEST_SUITE_END()

 The output is:
 ./testboost --log_level=all --report_level=detailed --output_format=xml
 <TestLog><TestSuite name="Master Test Suite"><TestSuite
 name="TestSuite"><TestCase name="testThrow"><Exception>unknown
 type</Exception><TestingTime>0</TestingTime></TestCase></TestSuite></TestSuite></TestLog><TestResult><TestSuite
 name="Master Test Suite" result="failed" assertions_passed="0"
 assertions_failed="1" expected_failures="0" test_cases_passed="0"
 test_cases_failed="1" test_cases_skipped="0"
 test_cases_aborted="1"><TestSuite name="TestSuite" result="failed"
 assertions_passed="0" assertions_failed="1" expected_failures="0"
 test_cases_passed="0" test_cases_failed="1" test_cases_skipped="0"
 test_cases_aborted="1"><TestCase name="testThrow" result="aborted"
 assertions_passed="0" assertions_failed="1"
 expected_failures="0"></TestCase></TestSuite></TestSuite></TestResult>

 The solution is to instrument the Boost.Test macros to include the
 checkpoints.

 [1] From : http://www.boost.org/doc/libs/1_45_0/libs/test/doc/html/utf
 /user-guide/test-output/test-log.html

 "In most cases The UTF can't provide an exact location, where system
 error occurs or uncaught C++ exception is thrown from. To be able to
 pinpoint it as close as possible the UTF keeps track of checkpoints -
 the location a test module passed through. '''A test case entrance and
 exit points, a test tool invocation point the UTF tracks
 automatically'''. Any other checkpoints should be entered by you
 manually. The test log provides two macros for this purpose:
 BOOST_TEST_CHECKPOINT - to specify a "named" checkpoint and
 BOOST_TEST_PASSPOINT - to specify an "unnamed" checkpoint."

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5008>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC