JetBrains/teamcity-cpp

All test in BOOST_DATA_TEST_CASE (boost 1.59) TeamCity see as single test which was run many times

ww898 opened this issue · 1 comments

ww898 commented

The TeamCity notification message includes only namespaces and name of the test. You also see much less number of tests in TeamCity.

ww898 commented

I found some problems in boost 1.59 to prevent fixing the issue. All test data stored in test context, but there is no test context before test will be run, because context is variable on stack in test_method(). See BOOST_TEST_CONTEXT in here:

    static void test_method( BOOST_DATA_TEST_CASE_PARAMS( params ) )    \
    {                                                                   \
        BOOST_TEST_CONTEXT( ""                                          \
            BOOST_PP_SEQ_FOR_EACH(BOOST_DATA_TEST_CONTEXT, _, params))  \
            _impl(BOOST_PP_SEQ_ENUM(params));                           \
    }                                                                   \

The second issue is in test name generation. Please see variable m_tc_name in here:

#define TC_MAKE(z,arity,_)                                                          \
    template<BOOST_PP_ENUM_PARAMS(arity, typename Arg)>                             \
    void    operator()( BOOST_PP_ENUM_BINARY_PARAMS(arity, Arg, const& arg) ) const \
    {                                                                               \
        m_test_cases.push_back( new test_case( m_tc_name, m_tc_file, m_tc_line,     \
         boost::bind( &TestCase::template test_method<BOOST_PP_ENUM_PARAMS(arity,Arg)>, \
         BOOST_PP_ENUM_PARAMS(arity, arg) ) ) );                                    \
    }                                                                               \