test icon indicating copy to clipboard operation
test copied to clipboard

Feature Request: BOOST_DATA_TEST_CASE with descriptive identifiers

Open notdanhan opened this issue 4 years ago • 1 comments

would it be possible for there to exist a variant of BOOST_DATA_TEST_CASE where something like


BOOST_DATA_TEST_CASE(my_data_test_case,
                       boost::unit_test::data::make({EMyEnum::val1, EMyEnum::val2, EMyEnum::val3}),
                       values)
{
    //Do Something
}

Could be identified using a syntax like

my_data_test_case/val1
my_data_test_case/val2
my_data_test_case/val3

or

my_data_test_case(val1)
my_data_test_case(val2)
my_data_test_case(val3)

instead of

my_data_test_case/_0
my_data_test_case/_1
my_data_test_case/_2

within the output from the test suite where val1, val2, val3, etc. represent the value produced by the given member of the dataset when using the insertion operator?

notdanhan avatar Feb 10 '22 20:02 notdanhan

This would lead in test cases that are either not directly runable with the --run_test command line argument, or that would not lead to a valid test name. Consider for instance the cases where there is a combination of values for each test cases (using eg. grid).

With this in mind, Boost.Test considers the my_data_test_case as a unique test /suite/ (we can run all the tests from it) and of course we can run each test individually. This would not be possible with the propose approach.

Does this make sense?

raffienficiaud avatar Feb 27 '22 19:02 raffienficiaud