summaryrefslogtreecommitdiff
path: root/src/cppunit
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-13 09:33:50 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-13 09:33:50 +0000
commitf1bf3276752a10a2cdf4e3cf3087399d199c4566 (patch)
tree13dc67edcf465f44b9fe835f5e0b201511774d07 /src/cppunit
parent570132ec2707c8bac6c27c758254f05e293fe613 (diff)
downloadcppunit-f1bf3276752a10a2cdf4e3cf3087399d199c4566.tar.gz
Include/cppunit/ui/text/TestRunner.
include/cppunit/ui/text/TestRunner.h: * src/cppunit/TextTestRunner.cpp: Renamed TextUi::TestRunner TextTestRunner and moved it to the CppUnit namespace. Added a deprecated typedef for compatibility with previous version. * include/cppunit/ui/text/TextTestRunner.h: added. * include/cppunit/ui/mfc/TestRunner.h: * src/cppunit/msvc6/testrunner/TestRunner.cpp: Renamed MfcUi::TestRunner MfcTestRunner. Added deprecated typedef for compatibility. Renamed TestRunner.cpp to MfcTestRunner.cpp. * include/cppunit/ui/mfc/MfcTestRunner.h: added. * include/cppunit/ui/qt/TestRunner.h: * src/qttestrunner/TestRunner.cpp: renamed QtUi::TestRunner QtTestRunner and moved it to CppUnit namespace. Added a deprecated typedef for compatibility. Renamed TestRunner.cpp to QtTestRunner.cpp. * include/cppunit/ui/qt/TestRunner.h: * src/qttestrunner/TestRunner.h: Moved TestRunner to CppUnit namespace and renamed it QtTestRunner. Added deprecated typedef for compatibility. * include/cppunit/Asserter.h: * src/cppunit/Asserter.cpp: changed namespace Asserter to a struct and made all methods static. * include/cppunit/extensions/HelperMacros.h: * include/cppunit/extensions/SourceLine.h: * include/cppunit/extensions/TestAssert.h: * include/cppunit/extensions/TestPlugIn.h: * include/cppunit/Portability.h: changed CPPUNIT_NS(symbol) to a symbol macro that expand either to CppUnit or nothing. The symbol is no longer a parameter. * include/cppunit/portability/CppUnitVector.h: * include/cppunit/portability/CppUnitDeque.h: * include/cppunit/portability/CppUnitMap.h: added. STL Wrapper for compilers that do not support template default argumenent and need the allocator to be passed when instantiating STL container. * examples/cppunittest/*.h: * examples/cppunittest/*.cpp: * src/msvc6/testrunner/*.h: * src/msvc6/testrunner/*.cpp: * src/msvc6/testpluginrunner/*.h: * src/msvc6/testpluginrunner/*.cpp: * src/qttestrunner/*.h: * src/qttestrunner/*.cpp: replaced occurence of CppUnit:: by CPPUNIT_NS. * src/cppunit/TestSuite.h: replaced occurence of std::vector by CppUnitVector.
Diffstat (limited to 'src/cppunit')
-rw-r--r--src/cppunit/Asserter.cpp58
-rw-r--r--src/cppunit/TestFactoryRegistry.cpp3
-rw-r--r--src/cppunit/TestSuite.cpp2
-rw-r--r--src/cppunit/TextTestRunner.cpp28
-rw-r--r--src/cppunit/cppunit.dsp25
5 files changed, 66 insertions, 50 deletions
diff --git a/src/cppunit/Asserter.cpp b/src/cppunit/Asserter.cpp
index 1c72aff..a9cf95c 100644
--- a/src/cppunit/Asserter.cpp
+++ b/src/cppunit/Asserter.cpp
@@ -6,29 +6,26 @@
CPPUNIT_NS_BEGIN
-namespace Asserter
-{
-
void
-fail( std::string message,
- const SourceLine &sourceLine )
+Asserter::fail( std::string message,
+ const SourceLine &sourceLine )
{
fail( Message( "assertion failed", message ), sourceLine );
}
void
-fail( const Message &message,
- const SourceLine &sourceLine )
+Asserter::fail( const Message &message,
+ const SourceLine &sourceLine )
{
throw Exception( message, sourceLine );
}
void
-failIf( bool shouldFail,
- const Message &message,
- const SourceLine &sourceLine )
+Asserter::failIf( bool shouldFail,
+ const Message &message,
+ const SourceLine &sourceLine )
{
if ( shouldFail )
fail( message, sourceLine );
@@ -36,33 +33,33 @@ failIf( bool shouldFail,
void
-failIf( bool shouldFail,
- std::string message,
- const SourceLine &sourceLine )
+Asserter::failIf( bool shouldFail,
+ std::string message,
+ const SourceLine &sourceLine )
{
failIf( shouldFail, Message( "assertion failed", message ), sourceLine );
}
std::string
-makeExpected( const std::string &expectedValue )
+Asserter::makeExpected( const std::string &expectedValue )
{
return "Expected: " + expectedValue;
}
std::string
-makeActual( const std::string &actualValue )
+Asserter::makeActual( const std::string &actualValue )
{
return "Actual : " + actualValue;
}
Message
-makeNotEqualMessage( const std::string &expectedValue,
- const std::string &actualValue,
- const AdditionalMessage &additionalMessage,
- const std::string &shortDescription )
+Asserter::makeNotEqualMessage( const std::string &expectedValue,
+ const std::string &actualValue,
+ const AdditionalMessage &additionalMessage,
+ const std::string &shortDescription )
{
Message message( shortDescription,
makeExpected( expectedValue ),
@@ -74,11 +71,11 @@ makeNotEqualMessage( const std::string &expectedValue,
void
-failNotEqual( std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage,
- std::string shortDescription )
+Asserter::failNotEqual( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage,
+ std::string shortDescription )
{
fail( makeNotEqualMessage( expected,
actual,
@@ -89,17 +86,16 @@ failNotEqual( std::string expected,
void
-failNotEqualIf( bool shouldFail,
- std::string expected,
- std::string actual,
- const SourceLine &sourceLine,
- const AdditionalMessage &additionalMessage,
- std::string shortDescription )
+Asserter::failNotEqualIf( bool shouldFail,
+ std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage,
+ std::string shortDescription )
{
if ( shouldFail )
failNotEqual( expected, actual, sourceLine, additionalMessage, shortDescription );
}
-} // namespace Asserter
CPPUNIT_NS_END
diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp
index b4c8e4f..095caa6 100644
--- a/src/cppunit/TestFactoryRegistry.cpp
+++ b/src/cppunit/TestFactoryRegistry.cpp
@@ -6,7 +6,8 @@
CPPUNIT_NS_BEGIN
-
+/*! \brief (INTERNAL) List of all TestFactoryRegistry.
+ */
class TestFactoryRegistryList
{
private:
diff --git a/src/cppunit/TestSuite.cpp b/src/cppunit/TestSuite.cpp
index e2db8ae..4a27788 100644
--- a/src/cppunit/TestSuite.cpp
+++ b/src/cppunit/TestSuite.cpp
@@ -38,7 +38,7 @@ TestSuite::addTest( Test *test )
}
-const std::vector<Test *> &
+const CppUnitVector<Test *> &
TestSuite::getTests() const
{
return m_tests;
diff --git a/src/cppunit/TextTestRunner.cpp b/src/cppunit/TextTestRunner.cpp
index 47a9cda..2be2d06 100644
--- a/src/cppunit/TextTestRunner.cpp
+++ b/src/cppunit/TextTestRunner.cpp
@@ -5,19 +5,18 @@
#include <cppunit/TextOutputter.h>
#include <cppunit/TextTestProgressListener.h>
#include <cppunit/TestResult.h>
-#include <cppunit/ui/text/TestRunner.h>
+#include <cppunit/ui/text/TextTestRunner.h>
#include <iostream>
#include <stdexcept>
CPPUNIT_NS_BEGIN
-namespace TextUi {
/*! Constructs a new text runner.
* \param outputter used to print text result. Owned by the runner.
*/
-TestRunner::TestRunner( Outputter *outputter )
+TextTestRunner::TextTestRunner( Outputter *outputter )
: m_outputter( outputter )
, m_result( new TestResultCollector() )
, m_eventManager( new TestResult() )
@@ -28,7 +27,7 @@ TestRunner::TestRunner( Outputter *outputter )
}
-TestRunner::~TestRunner()
+TextTestRunner::~TextTestRunner()
{
delete m_eventManager;
delete m_outputter;
@@ -51,16 +50,16 @@ TestRunner::~TestRunner()
* failed or was not found.
*/
bool
-TestRunner::run( std::string testName,
- bool doWait,
- bool doPrintResult,
- bool doPrintProgress )
+TextTestRunner::run( std::string testName,
+ bool doWait,
+ bool doPrintResult,
+ bool doPrintProgress )
{
TextTestProgressListener progress;
if ( doPrintProgress )
m_eventManager->addListener( &progress );
- SuperClass *pThis = this;
+ TestRunner *pThis = this;
pThis->run( *m_eventManager, testName );
if ( doPrintProgress )
@@ -74,7 +73,7 @@ TestRunner::run( std::string testName,
void
-TestRunner::wait( bool doWait )
+TextTestRunner::wait( bool doWait )
{
if ( doWait )
{
@@ -85,7 +84,7 @@ TestRunner::wait( bool doWait )
void
-TestRunner::printResult( bool doPrintResult )
+TextTestRunner::printResult( bool doPrintResult )
{
std::cout << std::endl;
if ( doPrintResult )
@@ -97,7 +96,7 @@ TestRunner::printResult( bool doPrintResult )
* Use this after calling run() to access the result of the test run.
*/
TestResultCollector &
-TestRunner::result() const
+TextTestRunner::result() const
{
return *m_result;
}
@@ -108,7 +107,7 @@ TestRunner::result() const
* test. Use this to register additional TestListener before running the tests.
*/
TestResult &
-TestRunner::eventManager() const
+TextTestRunner::eventManager() const
{
return *m_eventManager;
}
@@ -121,12 +120,11 @@ TestRunner::eventManager() const
* \see CompilerOutputter, XmlOutputter, TextOutputter.
*/
void
-TestRunner::setOutputter( Outputter *outputter )
+TextTestRunner::setOutputter( Outputter *outputter )
{
delete m_outputter;
m_outputter = outputter;
}
-} // namespace TextUi
CPPUNIT_NS_END
diff --git a/src/cppunit/cppunit.dsp b/src/cppunit/cppunit.dsp
index d618538..76564e1 100644
--- a/src/cppunit/cppunit.dsp
+++ b/src/cppunit/cppunit.dsp
@@ -189,6 +189,10 @@ SOURCE=.\TextTestRunner.cpp
SOURCE=..\..\include\cppunit\TextTestRunner.h
# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\ui\text\TextTestRunner.h
+# End Source File
# End Group
# Begin Group "portability"
@@ -211,11 +215,19 @@ SOURCE=..\..\include\cppunit\config\CppUnitApi.h
# End Source File
# Begin Source File
-SOURCE=..\..\include\cppunit\Portability.h
+SOURCE=..\..\include\cppunit\portability\CppUnitDeque.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\portability\CppUnitMap.h
# End Source File
# Begin Source File
-SOURCE=..\..\include\cppunit\config\PortabilityEpilog.h
+SOURCE=..\..\include\cppunit\portability\CppUnitVector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\Portability.h
# End Source File
# Begin Source File
@@ -248,6 +260,15 @@ SOURCE=..\..\include\cppunit\TextOutputter.h
# Begin Source File
SOURCE=.\XmlOutputter.cpp
+
+!IF "$(CFG)" == "cppunit - Win32 Release"
+
+!ELSEIF "$(CFG)" == "cppunit - Win32 Debug"
+
+# ADD CPP /W3
+
+!ENDIF
+
# End Source File
# Begin Source File