summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-06-01 08:48:42 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-06-01 09:24:28 (GMT)
commit2812bddd81f8a1b804c7460f4e14cd0aa393d129 (patch)
treed46294f35150c4f0f43deaf2d31fceaf945ae715 /3rdParty/CppUnit/cppunit/extensions/TestFixtureFactory.h
downloadswift-contrib-2812bddd81f8a1b804c7460f4e14cd0aa393d129.zip
swift-contrib-2812bddd81f8a1b804c7460f4e14cd0aa393d129.tar.bz2
Import.
Diffstat (limited to '3rdParty/CppUnit/cppunit/extensions/TestFixtureFactory.h')
-rw-r--r--3rdParty/CppUnit/cppunit/extensions/TestFixtureFactory.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/3rdParty/CppUnit/cppunit/extensions/TestFixtureFactory.h b/3rdParty/CppUnit/cppunit/extensions/TestFixtureFactory.h
new file mode 100644
index 0000000..45354c6
--- /dev/null
+++ b/3rdParty/CppUnit/cppunit/extensions/TestFixtureFactory.h
@@ -0,0 +1,50 @@
+#ifndef CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
+#define CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
+
+#include <cppunit/Portability.h>
+
+
+CPPUNIT_NS_BEGIN
+
+
+class TestFixture;
+
+/*! \brief Abstract TestFixture factory (Implementation).
+ *
+ * Implementation detail. Use by HelperMacros to handle TestFixture hierarchy.
+ */
+class TestFixtureFactory
+{
+public:
+ //! Creates a new TestFixture instance.
+ virtual TestFixture *makeFixture() =0;
+
+ virtual ~TestFixtureFactory() {}
+};
+
+
+/*! \brief Concret TestFixture factory (Implementation).
+ *
+ * Implementation detail. Use by HelperMacros to handle TestFixture hierarchy.
+ */
+template<class TestFixtureType>
+class ConcretTestFixtureFactory : public CPPUNIT_NS::TestFixtureFactory
+{
+ /*! \brief Returns a new TestFixture instance.
+ * \return A new fixture instance. The fixture instance is returned by
+ * the TestFixtureFactory passed on construction. The actual type
+ * is that of the fixture on which the static method suite()
+ * was called.
+ */
+ TestFixture *makeFixture()
+ {
+ return new TestFixtureType();
+ }
+};
+
+
+CPPUNIT_NS_END
+
+
+#endif // CPPUNIT_EXTENSIONS_TESTFIXTUREFACTORY_H
+