CppUnit project page | CppUnit home page |
Classes | |
class | CppUT::ExceptionGuardElement |
class | CppUT::ExceptionTranslatorGuard< ExceptionType, Translator > |
Helpers to provide simple exception translation. More... | |
class | CppUT::ExceptionGuard |
class | CppUT::Test |
class | CppUT::AbstractTestCase |
An abstract test case that can be run. More... | |
class | CppUT::TestCase |
A test case that can be run. More... | |
class | CppUT::AbstractTestSuite |
An abstract test suite that represents a collection of Test. More... | |
class | CppUT::TestSuite |
A test suite that represents a collection of Test. More... | |
Functions | |
template<class Translator, class ExceptionType> | |
void | CppUT::registerExceptionTranslation (ExceptionGuard &guard, Translator translator, CppTL::Type< ExceptionType >) |
Register an exception translator. | |
TestPtr | CppUT::makeTestCase (void(*run)(), const std::string &name) |
Creates a TestCase with the specified name and run functor. | |
TestPtr | CppUT::makeTestCase (const CppTL::Functor0 &run, const std::string &name) |
Creates a TestCase with the specified name and run functor. | |
TestPtr | CppUT::makeTestCase (const CppTL::Functor0 &setUp, const CppTL::Functor0 &run, const CppTL::Functor0 &tearDown, const std::string &name) |
Creates a TestCase with the specified name and setUp, run, and tearDown functor. | |
TestPtr | CppUT::makeFailingTestCase (const std::string &name, const Message &message) |
Creates a TestCase with the specified name that will always fail.
The test case run body simply call CPPUT_FAIL() with the specified message. | |
template<typename FixtureType> | |
TestPtr | CppUT::makeFixtureTestCase (const CppTL::IntrusivePtr< FixtureType > &fixture, const CppTL::Functor0 &run, const std::string &name) |
Creates a TestCase using a fixture-like object.
The test case will delegate implementation of AbstractTestCase setUp() and tearDown() to method of the same name on the given | |
TestSuitePtr | CppUT::makeTestSuite (const std::string &name) |
Creates a TestSuite with the specified name. |
TestPtr CppUT::makeFailingTestCase | ( | const std::string & | name, | |
const Message & | message | |||
) |
Creates a TestCase with the specified name that will always fail.
The test case run body simply call CPPUT_FAIL() with the specified message.
This is useful for example when a TestSuite is created from input data and those an invalid or inaccessible. A failing test case can be added to the suite to report the error.
TestPtr CppUT::makeFixtureTestCase | ( | const CppTL::IntrusivePtr< FixtureType > & | fixture, | |
const CppTL::Functor0 & | run, | |||
const std::string & | name | |||
) | [inline] |
Creates a TestCase using a fixture-like object.
The test case will delegate implementation of AbstractTestCase setUp() and tearDown() to method of the same name on the given fixture
object.
References CppUT::makeTestCase(), and CppTL::memfn0().
TestPtr CppUT::makeTestCase | ( | const CppTL::Functor0 & | setUp, | |
const CppTL::Functor0 & | run, | |||
const CppTL::Functor0 & | tearDown, | |||
const std::string & | name | |||
) |
Creates a TestCase with the specified name and setUp, run, and tearDown functor.
References CppUT::TestCase::TestCase().
TestPtr CppUT::makeTestCase | ( | const CppTL::Functor0 & | run, | |
const std::string & | name | |||
) |
TestPtr CppUT::makeTestCase | ( | void(*)() | run, | |
const std::string & | name | |||
) |
Creates a TestCase with the specified name and run functor.
References CppTL::cfn0(), CppUT::TestCase::run(), and CppUT::TestCase::TestCase().
Referenced by CppUT::makeFixtureTestCase(), and CppUT::TestFunctionFactory::operator()().
TestSuitePtr CppUT::makeTestSuite | ( | const std::string & | name | ) |
Creates a TestSuite with the specified name.
References CppUT::TestSuite::TestSuite().
Referenced by CppUT::Registry::createDefaultTests(), and CppUT::Registry::createTests().
void CppUT::registerExceptionTranslation | ( | ExceptionGuard & | guard, | |
Translator | translator, | |||
CppTL::Type< ExceptionType > | ||||
) | [inline] |
Register an exception translator.
static void translateMFCException( CException *e ) { TCHAR szCause[255]; ex.GetErrorMessage(szCause, 255); CString str( szCause ); OpenTest::Properties fault; fault["type"] = "unexpected exception"; fault["exception_type"] = "CException"; fault["message"].append( (const char *)str ); TestInfo::appendFaultToResult( fault ); }
failed
otherwise the test will not fail! References CppUT::ExceptionGuard::append().
hosts this site. |
Send comments to: CppUnit Developers |