summaryrefslogtreecommitdiff
path: root/include/cppunit
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2003-04-06 08:51:46 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2003-04-06 08:51:46 +0000
commit965425ea6d164a498e1349337a885fcc64b9b19f (patch)
tree1d2104fdf7aa07e391e4edb1f41c214671abf909 /include/cppunit
parentaf6bbfefca62714505166f7183c7be8d58d67615 (diff)
downloadcppunit-965425ea6d164a498e1349337a885fcc64b9b19f.tar.gz
include/cppunit/extensions/TestSuiteBuilder.h: removed (unused)
Diffstat (limited to 'include/cppunit')
-rw-r--r--include/cppunit/extensions/TestSuiteBuilder.h91
1 files changed, 0 insertions, 91 deletions
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 <cppunit/Portability.h>
-#include <cppunit/TestCaller.h>
-#include <cppunit/TestSuite.h>
-#include <cppunit/extensions/TestNamer.h>
-#include <memory>
-
-
-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 Fixture>
-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<Fixture>( makeTestName( methodName ),
- testMethod );
- addTest( test );
- }
-
- void addTestCaller( std::string methodName,
- TestMethod testMethod,
- Fixture *fixture )
- {
- Test *test =
- new TestCaller<Fixture>( makeTestName( methodName ),
- testMethod,
- fixture);
- addTest( test );
- }
-
- std::string makeTestName( const std::string &methodName )
- {
- return m_testNamer.getTestNameFor( methodName );
- }
-
-private:
- std::auto_ptr<TestSuite> m_suite;
- const TestNamer &m_testNamer;
-};
-
-
-CPPUNIT_NS_END
-
-#endif // CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H