[Boost-bugs] [Boost C++ Libraries] #7000: Patch let easy mixing auto registered test_suit test cases with manually registred

Subject: [Boost-bugs] [Boost C++ Libraries] #7000: Patch let easy mixing auto registered test_suit test cases with manually registred
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-06-19 20:11:09


#7000: Patch let easy mixing auto registered test_suit test cases with manually
registred
-----------------------------------------------------+----------------------
 Reporter: Vladimir Merzliakov <wanderer@…> | Owner: rogeeff
     Type: Patches | Status: new
Milestone: To Be Determined | Component: test
  Version: Boost 1.50.0 | Severity: Problem
 Keywords: |
-----------------------------------------------------+----------------------
 Currently not easy add manually registred test_cases/test_suits in
 autoreditred test_suits. Main problem in absent way get current test_suit
 context for register.

 But this problem easy fixed in suggested patch. With applied patch
 possible have like code:

 BOOST_AUTO_TEST_SUITE( AppTests )

 BOOST_AUTO_TEST_SUITE( AutoAddedTests )
 ...
 BOOST_AUTO_TEST_SUITE_END()

 BOOST_AUTO_TEST_SUITE( ManualAddedTests )

 static struct ManualAddedTestsReg {

     ManualAddedTestsReg() {

         current_test_suit().add( BOOST_TEST_CASE( &test_case1 ) );
         current_test_suit().add( BOOST_TEST_CASE( &test_case2 ) );
         ...
     }

 } manualAddedTestsReg;

 BOOST_AUTO_TEST_SUITE_END()

 BOOST_AUTO_TEST_SUITE_END()

 But most usefull case can be if need add different test cases list in some
 cases dependent from options. For example based at some directory test
 data files list, etc.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7000>
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:09 UTC