Boost C++ Libraries: Ticket #11854: Add fixture support in BOOST_DATA_TEST_CASE https://svn.boost.org/trac10/ticket/11854 <p> Now BOOST_DATA_TEST_CASE doesn't support test fixture at all. There is the ability to support this: </p> <pre class="wiki">#define BOOST_FIXTURE_DATA_TEST_CASE_IMPL( arity, test_name, F, dataset, params ) \ struct test_name : public F { \ template&lt;BOOST_PP_ENUM_PARAMS(arity, typename Arg)&gt; \ static void test_method( BOOST_DATA_TEST_CASE_PARAMS( params ) ) \ { \ BOOST_TEST_CHECKPOINT('"' &lt;&lt; #test_name &lt;&lt; "\" fixture entry."); \ test_name t; \ BOOST_TEST_CHECKPOINT('"' &lt;&lt; #test_name &lt;&lt; "\" entry."); \ BOOST_TEST_CONTEXT( "" \ BOOST_PP_SEQ_FOR_EACH(BOOST_DATA_TEST_CONTEXT, _, params)) \ t._impl(BOOST_PP_SEQ_ENUM(params)); \ BOOST_TEST_CHECKPOINT('"' &lt;&lt; #test_name &lt;&lt; "\" exit."); \ } \ private: \ template&lt;BOOST_PP_ENUM_PARAMS(arity, typename Arg)&gt; \ void _impl(BOOST_DATA_TEST_CASE_PARAMS( params )); \ }; \ \ BOOST_AUTO_TU_REGISTRAR( test_name )( \ boost::unit_test::data::ds_detail::make_test_case_gen&lt;test_name&gt;( \ BOOST_STRINGIZE( test_name ), \ __FILE__, __LINE__, \ boost::unit_test::data::make(dataset) ), \ boost::unit_test::decorator::collector::instance() ); \ \ template&lt;BOOST_PP_ENUM_PARAMS(arity, typename Arg)&gt; \ void test_name::_impl( BOOST_DATA_TEST_CASE_PARAMS( params ) ) \ /**/ #define BOOST_AUTO_DATA_TEST_CASE_WITH_PARAMS( test_name, dataset, ... ) \ BOOST_FIXTURE_DATA_TEST_CASE_IMPL( BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \ test_name, BOOST_AUTO_TEST_CASE_FIXTURE, dataset, \ BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__) ) \ /**/ #define BOOST_AUTO_DATA_TEST_CASE_NO_PARAMS( test_name, dataset ) \ BOOST_AUTO_DATA_TEST_CASE_WITH_PARAMS( test_name, dataset, sample ) \ /**/ #if BOOST_PP_VARIADICS_MSVC #define BOOST_AUTO_DATA_TEST_CASE( ... ) \ BOOST_PP_CAT( \ BOOST_PP_IIF(BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__),2), \ BOOST_AUTO_DATA_TEST_CASE_NO_PARAMS, \ BOOST_AUTO_DATA_TEST_CASE_WITH_PARAMS) (__VA_ARGS__), ) \ /**/ #else #define BOOST_AUTO_DATA_TEST_CASE( ... ) \ BOOST_PP_IIF(BOOST_PP_EQUAL(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__),2), \ BOOST_AUTO_DATA_TEST_CASE_NO_PARAMS, \ BOOST_AUTO_DATA_TEST_CASE_WITH_PARAMS) (__VA_ARGS__) \ /**/ #endif </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11854 Trac 1.4.3 Raffi Enficiaud Tue, 02 Feb 2016 08:39:10 GMT milestone changed https://svn.boost.org/trac10/ticket/11854#comment:1 https://svn.boost.org/trac10/ticket/11854#comment:1 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.61.0</span> </li> </ul> Ticket Raffi Enficiaud Mon, 29 Feb 2016 07:52:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11854#comment:2 https://svn.boost.org/trac10/ticket/11854#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Merged to master rev 6a3a616 </p> Ticket