13 #ifndef mitkTestCaller_h
14 #define mitkTestCaller_h
16 #include "cppunit/TestCase.h"
32 template <
class ParameterizedFixture>
35 typedef void (ParameterizedFixture::*TestMethod)();
45 : TestCase(name), m_OwnFixture(true), m_Fixture(new ParameterizedFixture()), m_Test(
test)
59 TestCaller(
const std::string &name, TestMethod
test, ParameterizedFixture &fixture)
60 : TestCase(name), m_OwnFixture(false), m_Fixture(&fixture), m_Test(
test)
74 TestCaller(
const std::string &name, TestMethod
test, ParameterizedFixture *fixture)
75 : TestCase(name), m_OwnFixture(true), m_Fixture(fixture), m_Test(
test)
92 ParameterizedFixture *fixture,
93 const std::vector<std::string> ¶m)
94 : TestCase(name), m_OwnFixture(true), m_Fixture(fixture), m_Test(
test)
96 m_Fixture->m_Parameter = param;
105 void runTest()
override { (m_Fixture->*m_Test)(); }
106 void setUp()
override { m_Fixture->setUp(); }
107 void tearDown()
override { m_Fixture->tearDown(); }
108 std::string
toString()
const {
return "TestCaller " + getName(); }
115 ParameterizedFixture *m_Fixture;