Boost C++ Libraries: Ticket #5008: Boost.Test does not do checkpointing of entry/exit of test cases https://svn.boost.org/trac10/ticket/5008 <p> I'm using boost 1.40. When <strong>parsing</strong> the output of a Boost.Test xml file, I sometimes get this error: </p> <p> "test-result.xml:cvc-complex-type.2.4.b: The content of element 'Exception' is not complete. One of '{<a class="missing wiki">LastCheckpoint</a>}' is expected." (output from Hudson Test plugin). </p> <p> 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<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a>. I can 'fix' this by inserting check/pass points at the beginning of every function, but shouldn't Boost.Test do this automatically ? </p> <p> Test case: </p> <p> struct A {}; </p> <p> BOOST_FIXTURE_TEST_SUITE( <a class="missing wiki">TestSuite</a>, A ) BOOST_AUTO_TEST_CASE(testThrow) { </p> <blockquote> <p> throw A(); </p> </blockquote> <p> } BOOST_AUTO_TEST_SUITE_END() </p> <p> The output is: ./testboost --log_level=all --report_level=detailed --output_format=xml &lt;<a class="missing wiki">TestLog</a>&gt;&lt;<a class="missing wiki">TestSuite</a> name="Master Test Suite"&gt;&lt;<a class="missing wiki">TestSuite</a> name="<a class="missing wiki">TestSuite</a>"&gt;&lt;<a class="missing wiki">TestCase</a> name="testThrow"&gt;&lt;Exception&gt;unknown type&lt;/Exception&gt;&lt;<a class="missing wiki">TestingTime</a>&gt;0&lt;<a class="missing wiki">/TestingTime</a>&gt;&lt;<a class="missing wiki">/TestCase</a>&gt;&lt;<a class="missing wiki">/TestSuite</a>&gt;&lt;<a class="missing wiki">/TestSuite</a>&gt;&lt;<a class="missing wiki">/TestLog</a>&gt;&lt;<a class="missing wiki">TestResult</a>&gt;&lt;<a class="missing wiki">TestSuite</a> 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"&gt;&lt;<a class="missing wiki">TestSuite</a> name="<a class="missing wiki">TestSuite</a>" 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"&gt;&lt;<a class="missing wiki">TestCase</a> name="testThrow" result="aborted" assertions_passed="0" assertions_failed="1" expected_failures="0"&gt;&lt;<a class="missing wiki">/TestCase</a>&gt;&lt;<a class="missing wiki">/TestSuite</a>&gt;&lt;<a class="missing wiki">/TestSuite</a>&gt;&lt;<a class="missing wiki">/TestResult</a>&gt; </p> <p> The solution is to instrument the Boost.Test macros to include the checkpoints. </p> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a> From : <a href="http://www.boost.org/doc/libs/1_45_0/libs/test/doc/html/utf/user-guide/test-output/test-log.html">http://www.boost.org/doc/libs/1_45_0/libs/test/doc/html/utf/user-guide/test-output/test-log.html</a> </p> <p> "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. <strong>A test case entrance and exit points, a test tool invocation point the UTF tracks automatically</strong>. 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." </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5008 Trac 1.4.3 Peter Soetens <peter@…> Tue, 21 Dec 2010 14:17:53 GMT attachment set https://svn.boost.org/trac10/ticket/5008 https://svn.boost.org/trac10/ticket/5008 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-checkpoint-test_method.patch</span> </li> </ul> <p> patch to boost.test for checkpointing in AUTO test-cases </p> Ticket Peter Soetens <peter@…> Tue, 21 Dec 2010 14:21:27 GMT <link>https://svn.boost.org/trac10/ticket/5008#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5008#comment:1</guid> <description> <p> The attachment adds the checkpointing before the fixture is is created, before the test is run, after the test is run (ie before the fixture is destructed). I believe this only fixes AUTO* test cases, not the 'regular C++' style testcases. </p> <p> Patch is against Boost 1.40. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Gennadiy Rozental</dc:creator> <pubDate>Mon, 17 Oct 2011 04:45:12 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5008#comment:2 https://svn.boost.org/trac10/ticket/5008#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket Raffi Enficiaud Tue, 07 Jul 2015 08:19:29 GMT <link>https://svn.boost.org/trac10/ticket/5008#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5008#comment:3</guid> <description> <p> Revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/75002" title="Added checkpoints at fixture entry points, test case entry point and ...">r75002</a> / e2d8dc1584e3b6a2c80e73cb5d1b9ece30d2a4d2 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Tue, 07 Jul 2015 08:19:36 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/5008#comment:4 https://svn.boost.org/trac10/ticket/5008#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.59.0</span> </li> </ul> Ticket