diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:08:07 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:09:00 +0900 |
commit | b5c87084afaef42b2d058f68091be31988a6a874 (patch) | |
tree | adef9a65870a41181687e11d57fdf98e7629de3c /boost/test/unit_test_suite.hpp | |
parent | 34bd32e225e2a8a94104489b31c42e5801cc1f4a (diff) | |
download | boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.gz boost-b5c87084afaef42b2d058f68091be31988a6a874.tar.bz2 boost-b5c87084afaef42b2d058f68091be31988a6a874.zip |
Imported Upstream version 1.64.0upstream/1.64.0
Change-Id: Id9212edd016dd55f21172c427aa7894d1d24148b
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/test/unit_test_suite.hpp')
-rw-r--r-- | boost/test/unit_test_suite.hpp | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/boost/test/unit_test_suite.hpp b/boost/test/unit_test_suite.hpp index 1dbcece78a..b434fa9f97 100644 --- a/boost/test/unit_test_suite.hpp +++ b/boost/test/unit_test_suite.hpp @@ -120,9 +120,9 @@ typedef F BOOST_AUTO_TEST_CASE_FIXTURE; \ // ************** BOOST_AUTO_TEST_SUITE_END ************** // // ************************************************************************** // -#define BOOST_AUTO_TEST_SUITE_END() \ -BOOST_AUTO_TU_REGISTRAR( BOOST_JOIN( end_suite, __LINE__ ) )( 1 ); \ -} \ +#define BOOST_AUTO_TEST_SUITE_END() \ +BOOST_AUTO_TU_REGISTRAR( end_suite )( 1 ); \ +} \ /**/ // ************************************************************************** // @@ -299,7 +299,7 @@ static boost::unit_test::ut_detail::global_fixture_impl<F> BOOST_JOIN( gf_, F ) #define BOOST_TEST_DECORATOR( D ) \ static boost::unit_test::decorator::collector const& \ -BOOST_JOIN(decorator_collector,__LINE__) = D; \ +BOOST_TEST_APPEND_UNIQUE_ID(decorator_collector) = D; \ /**/ // ************************************************************************** // @@ -321,9 +321,25 @@ typedef ::boost::unit_test::ut_detail::nil_t BOOST_AUTO_TEST_CASE_FIXTURE; // ************** Auto registration facility helper macros ************** // // ************************************************************************** // -#define BOOST_AUTO_TU_REGISTRAR( test_name ) \ -static boost::unit_test::ut_detail::auto_test_unit_registrar \ -BOOST_JOIN( BOOST_JOIN( test_name, _registrar ), __LINE__ ) \ +// Facility for having a unique name based on __LINE__ and __COUNTER__ (later if available) +#if defined(__COUNTER__) + #define BOOST_TEST_INTERNAL_HAS_COUNTER +#endif + +#if defined(BOOST_TEST_INTERNAL_HAS_COUNTER) + #define BOOST_TEST_APPEND_UNIQUE_ID( name ) \ + BOOST_JOIN( BOOST_JOIN( name, __LINE__ ), __COUNTER__) + /**/ +#else + #define BOOST_TEST_APPEND_UNIQUE_ID( name ) \ + BOOST_JOIN( name, __LINE__ ) + /**/ +#endif +/**/ + +#define BOOST_AUTO_TU_REGISTRAR( test_name ) \ +static boost::unit_test::ut_detail::auto_test_unit_registrar \ +BOOST_TEST_APPEND_UNIQUE_ID( BOOST_JOIN( test_name, _registrar ) ) \ /**/ #define BOOST_AUTO_TC_INVOKER( test_name ) BOOST_JOIN( test_name, _invoker ) #define BOOST_AUTO_TC_UNIQUE_ID( test_name ) BOOST_JOIN( test_name, _id ) |