Boost C++ Libraries: Ticket #7397: Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class https://svn.boost.org/trac10/ticket/7397 <p> Boost 1.48 introduced a new Boost.Timer library, deprecating the old one. Boost.Test still depends on the old class. This causes compilation problems. See thread <a class="ext-link" href="http://thread.gmane.org/gmane.comp.lib.boost.devel/234411"><span class="icon">​</span>Timer &amp; Boost.Test incompatibility</a> from the gmane.lib.boost.devel list. From the thread: </p> <p> When <code>boost/test/included/unit_test.hpp</code> is included in a unit test suite, you get compilation errors where <code>boost::timer</code> is declared as a class where previously it's defined as a namespace: </p> <pre class="wiki">boost/timer.hpp(45): error C2869: 'boost::timer' : has already been defined to be a namespace boost/test/impl/framework.ipp(153): error C2882: 'timer' : illegal use of namespace identifier in expression boost/test/impl/framework.ipp(153): fatal error C1903: unable to recover from previous error(s); stopping compilation </pre><p> I've attached a first attempt at a patch based on one I use in production from boost 1.49. </p> <p> Of note: </p> <ul><li>Use of the new timer classes can be disabled by defining the macro <code>BOOST_TEST_USE_DEPRECATED_TIMER</code> </li><li>Two new files are added to the <code>boost/test/utils</code> directory: <code>timer.hpp</code> and <code>progress.hpp</code> <ul><li><code>progress.hpp</code> is there to support progress output as was available in the deprecated boost timer but which is no longer part of the new timer classes as I recall </li></ul></li><li>I tried to keep the formatting essentially the same as other files in boost test with one exception - I refrained from adding $ tags as these are just noise. </li><li>I tried to maintain backwards compatibility for report output, notably XML output. </li><li>The new Boost.Timer is a compiled library and requires Boost.System. If you can't stomach that then the macro choosing the old version of Boost.Timer will help. </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7397 Trac 1.4.3 Jamie Allsop <ja11sop@…> Thu, 20 Sep 2012 23:35:56 GMT attachment set https://svn.boost.org/trac10/ticket/7397 https://svn.boost.org/trac10/ticket/7397 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_test_new_timer.diff</span> </li> </ul> <p> boost_test_new_timer.diff </p> Ticket Jamie Allsop <ja11sop@…> Mon, 24 Sep 2012 16:02:30 GMT <link>https://svn.boost.org/trac10/ticket/7397#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7397#comment:1</guid> <description> <p> These patches, attached to: </p> <p> </p><div><dl class="wiki compact"><dt><a class="closed" href="/trac10/ticket/7397" title="Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class">#7397</a></dt><dd>Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class</dd><dt><a class="closed" href="/trac10/ticket/7410" title="Test Units (Cases and Suites) in Boost.Test do not capture __FILE__ ...">#7410</a></dt><dd>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</dd><dt><a class="new" href="/trac10/ticket/7417" title="Detailed test status is not available in the Boost.Test log (status, ...">#7417</a></dt><dd>Detailed test status is not available in the Boost.Test log (status, assertions, passed) and so live test case status cannot be tracked</dd></dl></div><p> </p> <p> ...taken together allow for sophisticated test tools to be built on top of the Boost.Test output. </p> </description> <category>Ticket</category> </item> <item> <author>Sylvain Corlay <sylvain.corlay@…></author> <pubDate>Wed, 14 Nov 2012 16:06:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7397#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7397#comment:2</guid> <description> <p> Hi, do you know if there exists a workarround to use the new boost timers (boost::timer::cpu_timer) together with boost::test ? I tried, in a new header my_timer.h to do the following thing: </p> <pre class="wiki">namespace my { #include &lt;boost/timer/timer.hpp&gt; } </pre><p> and then use my::boost::timer::cpu_timer instead of boost::timer::cpu_timer. Unfortunately, this seems to create other compilation problems: </p> <pre class="wiki">In file included from /usr/include/boost/ratio/ratio.hpp:37:0, from /usr/include/boost/chrono/duration.hpp:41, from /usr/include/boost/chrono/chrono.hpp:11, from /usr/include/boost/timer/timer.hpp:14, /usr/include/boost/ratio/detail/mpl/abs.hpp:42:16: error: expected type-specifier before ‘na’ </pre><p> and a whole series of other errors in boost/raio/detail/mpl. I am using boost 1.48 and gcc 4.4 on a ubuntu 64-bit. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 02 Oct 2013 19:14:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7397#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7397#comment:3</guid> <description> <p> This still seems to be an issue in 1.54. Any updates? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Mon, 12 Jan 2015 14:04:20 GMT</pubDate> <title>owner, status, version changed https://svn.boost.org/trac10/ticket/7397#comment:4 https://svn.boost.org/trac10/ticket/7397#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">Raffi Enficiaud</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.52.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> </ul> <p> Merged into develop at 043a11ab711246eb69ea2b3209efcde401fc4ca0 </p> <p> See pull request <a class="ext-link" href="https://github.com/boostorg/test/pull/15"><span class="icon">​</span>https://github.com/boostorg/test/pull/15</a> </p> Ticket Raffi Enficiaud Mon, 12 Jan 2015 14:04:36 GMT status changed https://svn.boost.org/trac10/ticket/7397#comment:5 https://svn.boost.org/trac10/ticket/7397#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> </ul> Ticket Raffi Enficiaud Mon, 12 Jan 2015 14:04:56 GMT status changed https://svn.boost.org/trac10/ticket/7397#comment:6 https://svn.boost.org/trac10/ticket/7397#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Raffi Enficiaud Tue, 07 Jul 2015 08:31:29 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/7397#comment:7 https://svn.boost.org/trac10/ticket/7397#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <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 Raffi Enficiaud Tue, 07 Jul 2015 09:35:08 GMT status, milestone changed; resolution deleted https://svn.boost.org/trac10/ticket/7397#comment:8 https://svn.boost.org/trac10/ticket/7397#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.59.0</span> → <span class="trac-field-new">To Be Determined</span> </li> </ul> <p> Mistake: this work has been postponed because it broke the header only version of boost.test (indirect inclusion of boost.system) </p> Ticket Raffi Enficiaud Mon, 11 Feb 2019 23:54:54 GMT summary, milestone changed; keywords set https://svn.boost.org/trac10/ticket/7397#comment:9 https://svn.boost.org/trac10/ticket/7397#comment:9 <ul> <li><strong>keywords</strong> 1.70 added </li> <li><strong>summary</strong> <span class="trac-field-old">Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class - it should be updated to use the new class</span> → <span class="trac-field-new">Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.69</span> </li> </ul> <p> In branch <code>topic/GH-202-boost-timer-deprecation</code> for boost 1.70 </p> Ticket Raffi Enficiaud Wed, 27 Feb 2019 23:52:07 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7397#comment:10 https://svn.boost.org/trac10/ticket/7397#comment:10 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> In master, for 1.70 rev <code>412e3d5855cc7bee690cfc8d99ba7c3c0b043124</code> </p> Ticket