boostorg / test

The reference C++ unit testing framework (TDD, xUnit, C++03/11/14/17)
http://boost.org/libs/test
Boost Software License 1.0
179 stars 140 forks source link

Feature Request: BOOST_DATA_TEST_CASE with descriptive identifiers #326

Open notdanhan opened 2 years ago

notdanhan commented 2 years ago

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?

raffienficiaud commented 2 years ago

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?