17 #ifndef MITKTESTCALLER_H
18 #define MITKTESTCALLER_H
20 #include "cppunit/TestCase.h"
36 template <
class ParameterizedFixture>
39 typedef void (ParameterizedFixture::*TestMethod)();
49 : TestCase(name), m_OwnFixture(true), m_Fixture(new ParameterizedFixture()), m_Test(test)
63 TestCaller(
const std::string &name, TestMethod
test, ParameterizedFixture &fixture)
64 : TestCase(name), m_OwnFixture(false), m_Fixture(&fixture), m_Test(test)
78 TestCaller(
const std::string &name, TestMethod
test, ParameterizedFixture *fixture)
79 : TestCase(name), m_OwnFixture(true), m_Fixture(fixture), m_Test(test)
96 ParameterizedFixture *fixture,
97 const std::vector<std::string> ¶m)
98 : TestCase(name), m_OwnFixture(true), m_Fixture(fixture), m_Test(test)
100 m_Fixture->m_Parameter = param;
109 void runTest()
override { (m_Fixture->*m_Test)(); }
110 void setUp()
override { m_Fixture->setUp(); }
111 void tearDown()
override { m_Fixture->tearDown(); }
112 std::string
toString()
const {
return "TestCaller " + getName(); }
119 ParameterizedFixture *m_Fixture;
124 #endif // MITKTESTCALLER_H
TestCaller(const std::string &name, TestMethod test)
Follow Up Storage - Class to facilitate loading/accessing structured follow-up data.
std::string toString() const
DataCollection - Class to facilitate loading/accessing structured data.
TestCaller(const std::string &name, TestMethod test, ParameterizedFixture *fixture, const std::vector< std::string > ¶m)
TestCaller(const std::string &name, TestMethod test, ParameterizedFixture *fixture)
A test caller for parameterized tests.
TestCaller(const std::string &name, TestMethod test, ParameterizedFixture &fixture)
std::vector< std::string > globalCmdLineArgs