From 965425ea6d164a498e1349337a885fcc64b9b19f Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Sun, 6 Apr 2003 08:51:46 +0000 Subject: include/cppunit/extensions/TestSuiteBuilder.h: removed (unused) --- include/cppunit/extensions/TestSuiteBuilder.h | 91 --------------------------- 1 file changed, 91 deletions(-) delete mode 100644 include/cppunit/extensions/TestSuiteBuilder.h (limited to 'include/cppunit') diff --git a/include/cppunit/extensions/TestSuiteBuilder.h b/include/cppunit/extensions/TestSuiteBuilder.h deleted file mode 100644 index fb017ac..0000000 --- a/include/cppunit/extensions/TestSuiteBuilder.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H -#define CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H - -#include -#include -#include -#include -#include - - -CPPUNIT_NS_BEGIN - - -/*! \brief Helper to add tests to a TestSuite. - * \ingroup WritingTestFixture - * - * All tests added to the TestSuite are prefixed by TestSuite name. The resulting - * TestCase name has the following pattern: - * - * MyTestSuiteName.myTestName - * \see TestNamer. - */ -template -class TestSuiteBuilder -{ -public: - typedef void (Fixture::*TestMethod)(); - TestSuiteBuilder( TestSuite *suite, - const TestNamer &namer ) - : m_suite( suite ) - , m_testNamer( namer ) - { - } - - - TestSuiteBuilder( const TestNamer &namer ) - : m_suite( new TestSuite( namer.getFixtureName() ) ) - , m_testNamer( namer ) - { - } - - - TestSuite *suite() const - { - return m_suite.get(); - } - - TestSuite *takeSuite() - { - return m_suite.release(); - } - - void addTest( Test *test ) - { - m_suite->addTest( test ); - } - - void addTestCaller( std::string methodName, - TestMethod testMethod ) - { - Test *test = - new TestCaller( makeTestName( methodName ), - testMethod ); - addTest( test ); - } - - void addTestCaller( std::string methodName, - TestMethod testMethod, - Fixture *fixture ) - { - Test *test = - new TestCaller( makeTestName( methodName ), - testMethod, - fixture); - addTest( test ); - } - - std::string makeTestName( const std::string &methodName ) - { - return m_testNamer.getTestNameFor( methodName ); - } - -private: - std::auto_ptr m_suite; - const TestNamer &m_testNamer; -}; - - -CPPUNIT_NS_END - -#endif // CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H -- cgit v1.2.1