Opened 10 years ago

Closed 10 years ago

#7000 closed Patches (fixed)

Patch let easy mixing auto registered test_suit test cases with manually registred

Reported by: Vladimir Merzliakov <wanderer@…> Owned by: Gennadiy Rozental
Milestone: To Be Determined Component: test
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc:

Description

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.

Attachments (1)

current_test_suite.patch (1.4 KB ) - added by Vladimir Merzliakov <wanderer@…> 10 years ago.
Patch

Download all attachments as: .zip

Change History (2)

by Vladimir Merzliakov <wanderer@…>, 10 years ago

Attachment: current_test_suite.patch added

Patch

comment:1 by Gennadiy Rozental, 10 years ago

Resolution: fixed
Status: newclosed

(In [81193]) New feature: framework::current_auto_test_suite To be used to manually register test units in a middle of automatically registered test suite Fixes #7000

Note: See TracTickets for help on using tickets.