Name
TestSuiteBuilder
Description
The template class
TestSuiteBuilder
(see Figure C-32) is a
helper class used to add tests to a TestSuite. It
is used by the macros CPPUNIT_TEST_SUITE( ) and
CPPUNIT_TEST_SUITE_END( ).
TestSuiteBuilder belongs to the namespace
CppUnit. It is declared and implemented in the
file extensions/TestSuiteBuilder.h.
![]() |
Declaration
template<typename Fixture> class TestSuiteBuilder
Constructors/Destructors
-
TestSuiteBuilder(TestSuite *suite) Constructs a
TestSuiteBuilderfor aTestSuite.-
TestSuiteBuilder(string name) Constructs a
TestSuiteBuilderand a newTestSuitewith the given name.
Public Methods
-
void addTest(Test *test) Adds
testto theTestSuite.-
void addTestCaller(string methodName, TestMethod testMethod) Adds a
TestCallerthat calls theTestMethod.-
void addTestCaller(string methodName, TestMethod testMethod, Fixture *fixture) Adds a
TestCallerthat calls theTestMethodin the context of theFixture.-
template<typename ExceptionType>void addTestCallerForException(string methodName, TestMethod testMethod, Fixture *fixture, ExceptionType *dummyPointer) A template function to add a
TestCallerthat calls theTestMethodin the context of theFixture. TheTestMethodis expected to throw anExceptionof typeExceptionType.-
string makeTestName(const string &methodName) Returns a test name that incorporates the
TestSuite ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access
