1 #ifndef CPPUNIT_TESTCALLER_H // -*- C++ -*- 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();
207 #endif // CPPUNIT_TESTCALLER_H Exceptions thrown by failed assertions.Exception is an exception that serves descriptive strings thro...
Definition: Exception.h:19
Fixture * m_fixture
Definition: TestCaller.h:199
std::string getName() const
Returns the name of the test case.
Definition: TestCase.cpp:131
void runTest()
FIXME: this should probably be pure virtual.
Definition: TestCaller.h:173
TestCaller & operator=(const TestCaller &other)
void(Fixture::* TestMethod)()
Definition: TestCaller.h:108
std::string toString() const
Definition: TestCaller.h:188
void tearDown()
Clean up after the test run.
Definition: TestCaller.h:183
TestCaller(std::string name, TestMethod test, Fixture *fixture)
Definition: TestCaller.h:151
Generate a test case from a fixture method.A test caller provides access to a test case method on a t...
Definition: TestCaller.h:106
void setUp()
Set up context before running a test.
Definition: TestCaller.h:178
TestCaller(std::string name, TestMethod test, Fixture &fixture)
Definition: TestCaller.h:134
bool m_ownFixture
Definition: TestCaller.h:198
#define CPPUNIT_NS_END
Definition: Portability.h:106
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:105
~TestCaller()
Definition: TestCaller.h:167
static std::string getClassName(const std::type_info &info)
Get the class name of the specified type_info.
Definition: TypeInfoHelper.cpp:15
Message associated to an Exception.A message is composed of two items:
Definition: Message.h:34
TestCaller(std::string name, std::function< void()> test_function, Fixture *fixture)
Definition: TestCaller.h:159
TestCaller(std::string name, TestMethod test)
Definition: TestCaller.h:117
A single test object.
Definition: TestCase.h:27
#define CPPUNIT_API
Definition: CppUnitApi.h:27
std::function< void()> m_test_function
Definition: TestCaller.h:200