Test-case template is not running (which I assume is because of the comma), when using boost::mpl.

The code works in boost 1.55 as the test case name being used is a mangled name of the template. But upgrading to boost 1.64 the demangled name is now being used as test case name I.E:

test_case<foo<A,B>>

The code uses this template

template <bool arg1, typename arg2>
    struct test_template: public arg2
    {
        static const bool isEnabled = arg1;
    };

The code now declares an mpl container that contains two instantiated templates.

using test_templates = boost::mpl::vector<
        test_template<true, SPECIALIZED>,
        test_template<false, GENERIC>> ;

The code uses BOOST_AUTO_TEST_CASE_TEMPLATE to automatically register the test cases.

BOOST_AUTO_TEST_CASE_TEMPLATE(my_test, T, test_templates )
{
    BOOST_TEST( sizeof(T) == (unsigned)4 ); 
    //This will fail but this test case will not run at all in this example.
}

Now the testcases will be named:

   my_test<test_template<true,_SPECIALIZED>>
   my_test<test_template<false,_GENERIC>>

Because of the test case name having a comma in its name, boost.test is having trouble with it.

This code was working Back in boost 1.55 because boost assigned test-case names using mangled names of the instantiated templates (which is a long and weird looking name but doesnt have a comma)

Any ideas? I looked in boost documentation and there doesnt seem any word about using multiple parametered templates being put inside mpl for boost test use.

0

There are 0 answers