diff options
| author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-12-16 13:53:51 +0100 |
|---|---|---|
| committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-12-16 14:05:07 +0100 |
| commit | 4e529c6a6569d1f352e02af16e53aba7ae7bdc1a (patch) | |
| tree | bbbb7cfe6d872406cfa38381f91e6411ab9d6822 /include/cppunit/TestFailure.h | |
| parent | 923e2a837d515eb0d33792aba8bbb839f0012067 (diff) | |
| download | cppunit-4e529c6a6569d1f352e02af16e53aba7ae7bdc1a.tar.gz | |
implement parameterized tests
This allows to execute the same test with different parameters and
treats each execution as an own test. The change consists of two parts,
the TestCaller can now handle any callable which also makes it easy to
generate programatically more complex test cases as well as the new
CPPUNIT_TEST_PARAMETERIZED macro. That macro takes the test name as well
as an iteratable, e.g. std::initializer_list.
An example for this usage is:
class SimpleTest : public CppUnit::TestFixture
{
public:
CPPUNIT_TEST_SUITE(SimpleTest);
CPPUNIT_TEST_PARAMETERIZED(test, {1, 2, 3, 4});
CPPUNIT_TEST_SUITE_END();
void test(int i)
{
CPPUNIT_ASSERT(i < 5);
}
};
which will execute test 4 times with the values 1 to 4.
Diffstat (limited to 'include/cppunit/TestFailure.h')
0 files changed, 0 insertions, 0 deletions
