Subject: [Boost-bugs] [Boost C++ Libraries] #7397: Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class - it should be updated to use the new class
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-09-20 23:34:32
#7397: Boost.Test, since boost 1.48 is using the deprecated Boost.Timer class - it
should be updated to use the new class
---------------------------------+------------------------------------------
Reporter: ja11sop@⦠| Owner: rogeeff
Type: Patches | Status: new
Milestone: To Be Determined | Component: test
Version: Boost 1.52.0 | Severity: Problem
Keywords: |
---------------------------------+------------------------------------------
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
[http://thread.gmane.org/gmane.comp.lib.boost.devel/234411 Timer &
Boost.Test incompatibility] from the gmane.lib.boost.devel list. From the
thread:
When `boost/test/included/unit_test.hpp` is included in a unit test suite,
you get compilation errors where `boost::timer` is declared as a class
where previously it's defined as a namespace:
{{{
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
}}}
I've attached a first attempt at a patch based on one I use in production
from boost 1.49.
Of note:
* Use of the new timer classes can be disabled by defining the macro
`BOOST_TEST_USE_DEPRECATED_TIMER`
* Two new files are added to the `boost/test/utils` directory:
`timer.hpp` and `progress.hpp`
* `progress.hpp` 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
* 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.
* I tried to maintain backwards compatibility for report output, notably
XML output.
* 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.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7397> 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:10 UTC