Is it possible to mix up the BOOST_AUTO_TEST_CASE
and BOOST_AUTO_TEST_CASE_TEMPLATE
macros with the BOOST_PARAM_TEST_CASE
in any way? I\'m
Starting with Boost version 1.59, this is being handled by data-driven test cases:
#define BOOST_TEST_MODULE MainTest
#include
#include
#include
static const boost::array< int, 4 > DATA{ 1, 3, 4, 5 };
BOOST_DATA_TEST_CASE( Foo, DATA )
{
BOOST_TEST( sample % 2 );
}
This functionality requires C++11 support from compiler and library, and does not work inside a BOOST_AUTO_TEST_SUITE
.
If you have to support both old and new versions of Boost in your source, and / or pre-C++11 compilers, check out And-y's answer.