1 #ifndef CPPUNIT_TESTCALLER_H
2 #define CPPUNIT_TESTCALLER_H
10 #if defined(CPPUNIT_USE_TYPEINFO_NAME)
25 NoExceptionExpected();
33 template<
class ExceptionType>
34 struct ExpectedExceptionTraits
36 static void expectedException()
38 #if defined(CPPUNIT_USE_TYPEINFO_NAME)
40 "expected exception not thrown",
41 "Expected exception type: " +
44 throw Exception(
"expected exception not thrown" );
56 struct ExpectedExceptionTraits<NoExceptionExpected>
58 static void expectedException()
105 template <
class Fixture>
159 TestCaller(std::string name, std::function<
void()> test_function, Fixture* fixture):
190 return "TestCaller " +
getName();
#define CPPUNIT_API
Definition: CppUnitApi.h:27
#define CPPUNIT_NS_END
Definition: Portability.h:106
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:105
Exceptions thrown by failed assertions.
Definition: Exception.h:20
Message associated to an Exception.A message is composed of two items:
Definition: Message.h:35
Generate a test case from a fixture method.
Definition: TestCaller.h:107
TestCaller(std::string name, std::function< void()> test_function, Fixture *fixture)
Definition: TestCaller.h:159
void tearDown()
Clean up after the test run.
Definition: TestCaller.h:183
TestCaller(std::string name, TestMethod test, Fixture &fixture)
Definition: TestCaller.h:134
std::string toString() const
Definition: TestCaller.h:188
void(Fixture::* TestMethod)()
Definition: TestCaller.h:108
Fixture * m_fixture
Definition: TestCaller.h:199
TestCaller(std::string name, TestMethod test, Fixture *fixture)
Definition: TestCaller.h:151
TestCaller & operator=(const TestCaller &other)
~TestCaller()
Definition: TestCaller.h:167
TestCaller(std::string name, TestMethod test)
Definition: TestCaller.h:117
bool m_ownFixture
Definition: TestCaller.h:198
void runTest()
FIXME: this should probably be pure virtual.
Definition: TestCaller.h:173
void setUp()
Set up context before running a test.
Definition: TestCaller.h:178
TestCaller(const TestCaller &other)
std::function< void()> m_test_function
Definition: TestCaller.h:200
A single test object.
Definition: TestCase.h:29
std::string getName() const
Returns the name of the test case.
Definition: TestCase.cpp:131
static std::string getClassName(const std::type_info &info)
Get the class name of the specified type_info.
Definition: TypeInfoHelper.cpp:15