summaryrefslogtreecommitdiff
path: root/src/cppunit
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 /src/cppunit
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 'src/cppunit')
-rw-r--r--src/cppunit/DllMain.cpp10
-rw-r--r--src/cppunit/Makefile.am4
-rw-r--r--src/cppunit/TestSetUp.cpp31
-rw-r--r--src/cppunit/TestSuite.cpp91
-rw-r--r--src/cppunit/cppunit.dsp8
-rw-r--r--src/cppunit/cppunit_dll.dsp365
6 files changed, 467 insertions, 42 deletions
diff --git a/src/cppunit/DllMain.cpp b/src/cppunit/DllMain.cpp
new file mode 100644
index 0000000..c1531c5
--- /dev/null
+++ b/src/cppunit/DllMain.cpp
@@ -0,0 +1,10 @@
+#define VC_EXTRALEAN
+#include <windows.h>
+
+BOOL APIENTRY
+DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved )
+{
+ return TRUE;
+}
diff --git a/src/cppunit/Makefile.am b/src/cppunit/Makefile.am
index ef0df40..748f415 100644
--- a/src/cppunit/Makefile.am
+++ b/src/cppunit/Makefile.am
@@ -1,5 +1,5 @@
#
-# $Id: Makefile.am,v 1.16 2002-03-03 11:57:26 blep Exp $
+# $Id: Makefile.am,v 1.17 2002-03-24 19:39:55 blep Exp $
#
EXTRA_DIST = cppunit.dsw cppunit.dsp
@@ -10,6 +10,7 @@ lib_LTLIBRARIES = libcppunit.la
libcppunit_la_SOURCES = \
Asserter.cpp \
CompilerOutputter.cpp \
+ DllMain.cpp \
Exception.cpp \
NotEqualException.cpp \
RepeatedTest.cpp \
@@ -22,6 +23,7 @@ libcppunit_la_SOURCES = \
TestResult.cpp \
TestRegistry.cpp \
TestResultCollector.cpp \
+ TestSetUp.cpp \
TestSucessListener.cpp \
TestSuite.cpp \
TextOutputter.cpp \
diff --git a/src/cppunit/TestSetUp.cpp b/src/cppunit/TestSetUp.cpp
new file mode 100644
index 0000000..a55339c
--- /dev/null
+++ b/src/cppunit/TestSetUp.cpp
@@ -0,0 +1,31 @@
+#include <cppunit/extensions/TestSetUp.h>
+
+namespace CppUnit {
+
+TestSetUp::TestSetUp( Test *test ) : TestDecorator( test )
+{
+}
+
+
+void
+TestSetUp::setUp()
+{
+}
+
+
+void
+TestSetUp::tearDown()
+{
+}
+
+
+void
+TestSetUp::run( TestResult *result )
+{
+ setUp();
+ TestDecorator::run(result);
+ tearDown();
+}
+
+
+} // namespace CppUnit
diff --git a/src/cppunit/TestSuite.cpp b/src/cppunit/TestSuite.cpp
index 33ea2ce..7659939 100644
--- a/src/cppunit/TestSuite.cpp
+++ b/src/cppunit/TestSuite.cpp
@@ -3,85 +3,94 @@
namespace CppUnit {
+/// Default constructor
+TestSuite::TestSuite( std::string name )
+ : m_name( name )
+{
+}
+
+
+/// Destructor
+TestSuite::~TestSuite()
+{
+ deleteContents();
+}
+
+
/// Deletes all tests in the suite.
-void TestSuite::deleteContents ()
+void
+TestSuite::deleteContents()
{
- for (std::vector<Test *>::iterator it = m_tests.begin ();
- it != m_tests.end ();
- ++it)
+ for ( std::vector<Test *>::iterator it = m_tests.begin();
+ it != m_tests.end();
+ ++it)
delete *it;
m_tests.clear();
}
+
/// Runs the tests and collects their result in a TestResult.
-void TestSuite::run (TestResult *result)
+void
+TestSuite::run( TestResult *result )
{
- for (std::vector<Test *>::iterator it = m_tests.begin ();
- it != m_tests.end ();
- ++it) {
- if (result->shouldStop ())
- break;
-
- Test *test = *it;
- test->run (result);
- }
-
+ for ( std::vector<Test *>::iterator it = m_tests.begin();
+ it != m_tests.end();
+ ++it )
+ {
+ if ( result->shouldStop() )
+ break;
+
+ Test *test = *it;
+ test->run( result );
+ }
}
/// Counts the number of test cases that will be run by this test.
-int TestSuite::countTestCases () const
+int
+TestSuite::countTestCases() const
{
- int count = 0;
+ int count = 0;
- for (std::vector<Test *>::const_iterator it = m_tests.begin ();
- it != m_tests.end ();
- ++it)
- count += (*it)->countTestCases ();
-
- return count;
+ for ( std::vector<Test *>::const_iterator it = m_tests.begin();
+ it != m_tests.end();
+ ++it )
+ count += (*it)->countTestCases();
+ return count;
}
-/// Default constructor
-TestSuite::TestSuite (std::string name)
- : m_name (name)
-{
-}
-
-/// Destructor
-TestSuite::~TestSuite ()
-{
- deleteContents ();
-}
/// Adds a test to the suite.
void
- TestSuite::addTest (Test *test)
+TestSuite::addTest( Test *test )
{
- m_tests.push_back (test);
+ m_tests.push_back( test );
}
/// Returns a string representation of the test suite.
std::string
- TestSuite::toString () const
+TestSuite::toString() const
{
- return "suite " + getName();
+ return "suite " + getName();
}
+
/// Returns the name of the test suite.
std::string
- TestSuite::getName () const
+TestSuite::getName() const
{
return m_name;
}
-const std::vector<Test *>&
- TestSuite::getTests () const
+
+const std::vector<Test *> &
+TestSuite::getTests() const
{
return m_tests;
}
+
} // namespace CppUnit
diff --git a/src/cppunit/cppunit.dsp b/src/cppunit/cppunit.dsp
index e1120e1..87bd078 100644
--- a/src/cppunit/cppunit.dsp
+++ b/src/cppunit/cppunit.dsp
@@ -126,6 +126,10 @@ SOURCE=..\..\include\cppunit\extensions\TestDecorator.h
# End Source File
# Begin Source File
+SOURCE=.\TestSetUp.cpp
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\cppunit\extensions\TestSetUp.h
# End Source File
# End Group
@@ -356,6 +360,10 @@ SOURCE=..\..\ChangeLog
# End Source File
# Begin Source File
+SOURCE="..\..\INSTALL-WIN32.txt"
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\cppunit\Makefile.am
# End Source File
# Begin Source File
diff --git a/src/cppunit/cppunit_dll.dsp b/src/cppunit/cppunit_dll.dsp
new file mode 100644
index 0000000..8053a59
--- /dev/null
+++ b/src/cppunit/cppunit_dll.dsp
@@ -0,0 +1,365 @@
+# Microsoft Developer Studio Project File - Name="cppunit_dll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=cppunit_dll - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "cppunit_dll.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "cppunit_dll.mak" CFG="cppunit_dll - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "cppunit_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "cppunit_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "cppunit_dll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "cppunit_dll___Win32_Release"
+# PROP BASE Intermediate_Dir "cppunit_dll___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseDLL"
+# PROP Intermediate_Dir "ReleaseDLL"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPPUNIT_DLL_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPPUNIT_BUILD_DLL" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:"..\..\lib\cppunit_dll.pdb" /machine:I386 /out:"..\..\lib\cppunit_dll.dll" /implib:"..\..\lib\cppunit_dll.lib"
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "cppunit_dll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "cppunit_dll___Win32_Debug"
+# PROP BASE Intermediate_Dir "cppunit_dll___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugDLL"
+# PROP Intermediate_Dir "DebugDLL"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPPUNIT_DLL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CPPUNIT_BUILD_DLL" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /pdb:"..\..\lib\cppunitd_dll.pdb" /debug /machine:I386 /out:"..\..\lib\cppunitd_dll.dll" /implib:"..\..\lib\cppunitd_dll.lib" /pdbtype:sept
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "cppunit_dll - Win32 Release"
+# Name "cppunit_dll - Win32 Debug"
+# Begin Group "extension"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\Orthodox.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\RepeatedTest.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\RepeatedTest.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\TestDecorator.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestSetUp.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\TestSetUp.h
+# End Source File
+# End Group
+# Begin Group "helper"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\AutoRegisterSuite.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\HelperMacros.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestCaller.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\TestFactory.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestFactoryRegistry.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\TestFactoryRegistry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\TestSuiteBuilder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\TestSuiteFactory.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TypeInfoHelper.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\extensions\TypeInfoHelper.h
+# End Source File
+# End Group
+# Begin Group "core"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Asserter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\Asserter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Exception.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\Exception.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\NotEqualException.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\NotEqualException.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\SourceLine.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\SourceLine.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\SynchronizedObject.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\SynchronizedObject.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\Test.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestAssert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestAssert.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestCase.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestCase.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestFailure.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestFailure.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestListener.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestResult.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestResult.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestSuite.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestSuite.h
+# End Source File
+# End Group
+# Begin Group "output"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\CompilerOutputter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\CompilerOutputter.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\Outputter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestResultCollector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestResultCollector.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TestSucessListener.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TestSucessListener.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextOutputter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TextOutputter.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextTestProgressListener.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TextTestProgressListener.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextTestResult.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TextTestResult.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextTestRunner.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\TextTestRunner.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\XmlOutputter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\XmlOutputter.h
+# End Source File
+# End Group
+# Begin Group "portability"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE="..\..\include\cppunit\config-msvc6.h"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\Portability.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\ChangeLog
+# End Source File
+# Begin Source File
+
+SOURCE=.\DllMain.cpp
+# End Source File
+# Begin Source File
+
+SOURCE="..\..\INSTALL-WIN32.txt"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\Makefile.am
+# End Source File
+# Begin Source File
+
+SOURCE=.\Makefile.am
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\NEWS
+# End Source File
+# End Target
+# End Project