summaryrefslogtreecommitdiff
path: root/include/cppunit/extensions
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-03-24 18:39:55 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-03-24 18:39:55 +0000
commitc37e0491c761f8b8499163bf7e748ea1afcf9203 (patch)
treee299faf6dc3d4f5c54493a82218f9450ddb091b7 /include/cppunit/extensions
parente13f6632c91fdd1a866800392f4fb12c238d14ba (diff)
downloadcppunit-c37e0491c761f8b8499163bf7e748ea1afcf9203.tar.gz
INSTALL-WIN32.
INSTALL-WIN32.txt: added some info to build cppunit as a DLL. * include/cppunit/config-msvc6.h: added definition of macro CPPUNIT_API when building or linking DLL. Defined CPPUNIT_BUILD_DLL when building, and CPPUNIT_DLL when linking. * include/cppunit/Portability.h: added empty definition of macro CPPUNIT_API when not building or using CppUnit as a DLL. When any of those symbol is defined, the symbol CPPUNIT_NEED_DLL_DECL is set to 1. * include/cppunit/extensions/RepeatedTest.h: * include/cppunit/extensions/TestDecorator.h: * include/cppunit/extensions/TestSetUp.h: * include/cppunit/TestCaller.h * include/cppunit/extensions/TestFactory.h * include/cppunit/extensions/TestFactoryRegistry.h * include/cppunit/extensions/TypeInfoHelper.h * include/cppunit/Asserter.h * include/cppunit/Exception.h * include/cppunit/NotEqualException.h * include/cppunit/SourceLine.h * include/cppunit/SynchronizedObject.h * include/cppunit/Test.h * include/cppunit/TestAssert.h * include/cppunit/TestCase.h * include/cppunit/TestFailure.h * include/cppunit/TestListener.h * include/cppunit/TestResult.h * include/cppunit/TestSuite.h * include/cppunit/CompilerOutputter.h * include/cppunit/Outputter.h * include/cppunit/TestResultCollector.h * include/cppunit/TestSuccessListener.h * include/cppunit/TextOutputter.h * include/cppunit/TextTestProgressListener.h * include/cppunit/TextTestResult.h * include/cppunit/TextTestRunner.h * include/cppunit/XmlOutputter.h: added CPPUNIT_API for DLL export. * include/cppunit/TestSuite.h: * src/cppunit/TestSuite.cpp: reindented * include/cppunit/extensions/TestSetUp.h: * src/cppunit/TestSetUp.cpp: added .cpp. extracted inline method and moved them to cpp file.
Diffstat (limited to 'include/cppunit/extensions')
-rw-r--r--include/cppunit/extensions/RepeatedTest.h3
-rw-r--r--include/cppunit/extensions/TestDecorator.h3
-rw-r--r--include/cppunit/extensions/TestFactory.h26
-rw-r--r--include/cppunit/extensions/TestFactoryRegistry.h121
-rw-r--r--include/cppunit/extensions/TestSetUp.h19
-rw-r--r--include/cppunit/extensions/TestSuiteFactory.h2
-rw-r--r--include/cppunit/extensions/TypeInfoHelper.h2
7 files changed, 88 insertions, 88 deletions
diff --git a/include/cppunit/extensions/RepeatedTest.h b/include/cppunit/extensions/RepeatedTest.h
index e27b53e..067fd20 100644
--- a/include/cppunit/extensions/RepeatedTest.h
+++ b/include/cppunit/extensions/RepeatedTest.h
@@ -1,6 +1,7 @@
#ifndef CPPUNIT_EXTENSIONS_REPEATEDTEST_H
#define CPPUNIT_EXTENSIONS_REPEATEDTEST_H
+#include <cppunit/Portability.h>
#include <cppunit/extensions/TestDecorator.h>
namespace CppUnit {
@@ -13,7 +14,7 @@ class TestResult;
*
* Does not assume ownership of the test it decorates
*/
-class RepeatedTest : public TestDecorator
+class CPPUNIT_API RepeatedTest : public TestDecorator
{
public:
RepeatedTest( Test *test,
diff --git a/include/cppunit/extensions/TestDecorator.h b/include/cppunit/extensions/TestDecorator.h
index 2a6b9d7..c3dc343 100644
--- a/include/cppunit/extensions/TestDecorator.h
+++ b/include/cppunit/extensions/TestDecorator.h
@@ -1,6 +1,7 @@
#ifndef CPPUNIT_EXTENSIONS_TESTDECORATOR_H
#define CPPUNIT_EXTENSIONS_TESTDECORATOR_H
+#include <cppunit/Portability.h>
#include <cppunit/Test.h>
namespace CppUnit {
@@ -16,7 +17,7 @@ class TestResult;
*
* Does not assume ownership of the test it decorates
*/
-class TestDecorator : public Test
+class CPPUNIT_API TestDecorator : public Test
{
public:
TestDecorator (Test *test);
diff --git a/include/cppunit/extensions/TestFactory.h b/include/cppunit/extensions/TestFactory.h
index 0658a09..3b1f001 100644
--- a/include/cppunit/extensions/TestFactory.h
+++ b/include/cppunit/extensions/TestFactory.h
@@ -1,22 +1,24 @@
#ifndef CPPUNIT_EXTENSIONS_TESTFACTORY_H
#define CPPUNIT_EXTENSIONS_TESTFACTORY_H
+#include <cppunit/Portability.h>
+
namespace CppUnit {
- class Test;
+class Test;
- /** This class represents an abstract Test factory.
- */
- class TestFactory
- {
- public:
- virtual ~TestFactory() {}
+/** This class represents an abstract Test factory.
+ */
+class CPPUNIT_API TestFactory
+{
+public:
+ virtual ~TestFactory() {}
- /** Makes a new test.
- * \return A new Test.
- */
- virtual Test* makeTest() = 0;
- };
+ /** Makes a new test.
+ * \return A new Test.
+ */
+ virtual Test* makeTest() = 0;
+};
} // namespace CppUnit
diff --git a/include/cppunit/extensions/TestFactoryRegistry.h b/include/cppunit/extensions/TestFactoryRegistry.h
index a9edea2..5583d1a 100644
--- a/include/cppunit/extensions/TestFactoryRegistry.h
+++ b/include/cppunit/extensions/TestFactoryRegistry.h
@@ -8,66 +8,71 @@
namespace CppUnit {
- class TestSuite;
+class TestSuite;
+
+#if CPPUNIT_NEED_DLL_DECL
+ template class CPPUNIT_API std::map<std::string, TestFactory *>;
+#endif
+
+
+/** This class implements a registry for test factory.
+ *
+ * Note that the registry assume lifetime control for any registered test.
+ */
+class CPPUNIT_API TestFactoryRegistry : public TestFactory
+{
+public:
+ /** Constructs the registry with the specified name.
+ * \param name Name of the registry.
+ */
+ TestFactoryRegistry( std::string name = "All Tests" );
+
+ /// Destructor.
+ virtual ~TestFactoryRegistry();
+
+ /** Makes a suite containing all the registered test.
+ * \return A new suite containing all the registered test.
+ */
+ virtual Test *makeTest();
+
+ /** Returns the registry.
+ * \return Registry.
+ */
+ static TestFactoryRegistry &getRegistry();
+
+ /** Returns a named registry.
+ * \param name Name of the registry to return.
+ * \return Registry. If the registry does not exist, it is created.
+ */
+ static TestFactoryRegistry &getRegistry( const std::string &name );
- /** This class implements a registry for test factory.
- *
- * Note that the registry assume lifetime control for any registered test.
+ /** Adds the registered test to the specified suite.
+ * \param suite Suite the test are added to.
*/
- class TestFactoryRegistry : public TestFactory
- {
- public:
- /** Constructs the registry with the specified name.
- * \param name Name of the registry.
- */
- TestFactoryRegistry( std::string name = "All Tests" );
-
- /// Destructor.
- virtual ~TestFactoryRegistry();
-
- /** Makes a suite containing all the registered test.
- * \return A new suite containing all the registered test.
- */
- virtual Test *makeTest();
-
- /** Returns the registry.
- * \return Registry.
- */
- static TestFactoryRegistry &getRegistry();
-
- /** Returns a named registry.
- * \param name Name of the registry to return.
- * \return Registry. If the registry does not exist, it is created.
- */
- static TestFactoryRegistry &getRegistry( const std::string &name );
-
- /** Adds the registered test to the specified suite.
- * \param suite Suite the test are added to.
- */
- void addTestToSuite( TestSuite *suite );
-
- /** Registers a test factory with the specified name.
- * \param name Name associated to the factory.
- * \param factory Factory to register.
- */
- void registerFactory( const std::string &name,
- TestFactory *factory );
-
- /** Registers a test factory using its class name.
- * \param factory Factory to register.
- */
- void registerFactory( TestFactory *factory );
-
- private:
- TestFactoryRegistry( const TestFactoryRegistry &copy );
- void operator =( const TestFactoryRegistry &copy );
-
- private:
- typedef std::map<std::string, TestFactory *> Factories;
- Factories m_factories;
-
- std::string m_name;
- };
+ void addTestToSuite( TestSuite *suite );
+
+ /** Registers a test factory with the specified name.
+ * \param name Name associated to the factory.
+ * \param factory Factory to register.
+ */
+ void registerFactory( const std::string &name,
+ TestFactory *factory );
+
+ /** Registers a test factory using its class name.
+ * \param factory Factory to register.
+ */
+ void registerFactory( TestFactory *factory );
+
+private:
+ TestFactoryRegistry( const TestFactoryRegistry &copy );
+ void operator =( const TestFactoryRegistry &copy );
+
+private:
+ typedef std::map<std::string, TestFactory *> Factories;
+ Factories m_factories;
+
+ std::string m_name;
+};
diff --git a/include/cppunit/extensions/TestSetUp.h b/include/cppunit/extensions/TestSetUp.h
index c97402c..0fe2663 100644
--- a/include/cppunit/extensions/TestSetUp.h
+++ b/include/cppunit/extensions/TestSetUp.h
@@ -9,16 +9,16 @@ class Test;
class TestResult;
-class TestSetUp : public TestDecorator
+class CPPUNIT_API TestSetUp : public TestDecorator
{
public:
- TestSetUp (Test *test) : TestDecorator (test) {}
+ TestSetUp( Test *test );
- void run (TestResult *result);
+ void run( TestResult *result );
protected:
- virtual void setUp () {}
- virtual void tearDown () {}
+ virtual void setUp();
+ virtual void tearDown();
private:
TestSetUp( const TestSetUp & );
@@ -26,15 +26,6 @@ private:
};
-inline void
-TestSetUp::run (TestResult *result)
-{
- setUp ();
- TestDecorator::run (result);
- tearDown ();
-}
-
-
} // namespace CppUnit
#endif // CPPUNIT_EXTENSIONS_TESTSETUP_H
diff --git a/include/cppunit/extensions/TestSuiteFactory.h b/include/cppunit/extensions/TestSuiteFactory.h
index a54311b..cc07471 100644
--- a/include/cppunit/extensions/TestSuiteFactory.h
+++ b/include/cppunit/extensions/TestSuiteFactory.h
@@ -8,7 +8,7 @@ namespace CppUnit {
class Test;
template<typename TestCaseType>
- class TestSuiteFactory : public TestFactory
+ class TestSuiteFactory : public TestFactory
{
public:
virtual Test *makeTest()
diff --git a/include/cppunit/extensions/TypeInfoHelper.h b/include/cppunit/extensions/TypeInfoHelper.h
index f4008ef..5199a70 100644
--- a/include/cppunit/extensions/TypeInfoHelper.h
+++ b/include/cppunit/extensions/TypeInfoHelper.h
@@ -12,7 +12,7 @@ namespace CppUnit {
/** Helper to use type_info.
*/
- class TypeInfoHelper
+ class CPPUNIT_API TypeInfoHelper
{
public:
/** Get the class name of the specified type_info.