summaryrefslogtreecommitdiff
path: root/examples/cppunittest
Commit message (Collapse)AuthorAgeFilesLines
* add parameterized test callersfeature/parameterizedMarkus Mohrhard2015-11-083-0/+78
|
* add a flag for adding optional featuresMarkus Mohrhard2015-11-072-11/+11
| | | | | | These features will switch the used C++ version from C++03 to C++11. We are also going to use std::unique_ptr instead of std::auto_ptr for the c++11 mode.
* add new assertion macros for <, <=, > and >=Markus Mohrhard2014-07-132-0/+53
| | | | | | | | | Now we support the following new macros: - CPPUNIT_ASSERT_LESS - CPPUNIT_ASSERT_GREATER - CPPUNIT_ASSERT_LESSEQUAL - CPPUNIT_ASSERT_GREATEREQUAL
* a bit warning cleaning in the testsMarkus Mohrhard2012-06-161-0/+4
| | | | -Werror -Wall -Wextra now works in make and in make check
* Applied patch #2807259: lib -ldl... should be in LDADD instead of LDFLAGSBaptiste Lepilleur2009-11-231-5/+2
|
* Added updated project and instructions for building under Visual Studio.Net 2008Andy Dent2008-12-162-0/+2946
|
* Changes to suppress warnings of gcc -Wall -W -ansi, mainly from patch [1898225].Steve M. Robbins2008-02-214-15/+15
|
* - removed wrong comment.Baptiste Lepilleur2007-02-251-1/+1
|
* Src/cppunit/TestAssert.Baptiste Lepilleur2007-02-242-3/+42
| | | | | | | | | | | | | | | | | | | src/cppunit/TestAssert.cpp (assertDoubleEquals): Moved finite & NaN tests to include/cppunit/portability/FloatingPoint.h. Changed implementation assertDoubleEquals to explicitly test for NaN in case of non-finite values to force equality failure in the presence of NaN. Previous implementation failed on Microsoft Visual Studio 6 (on this platform: NaN == NaN). * examples/cppunittest/TestAssertTest.cpp: Add more unit tests to test the portable floating-point primitive. Added missing include <limits>. * include/cppunit/portability/Makefile.am: * include/cppunit/portability/FloatingPoint.h: Added file. Extracted isfinite() from TestAssert.cpp. * include/cppunit/config-evc4: * include/cppunit/config-msvc6: Added support for _finite().
* Add tests of the precision generated bySteve M. Robbins2007-01-315-1/+86
| | | | assertion_traits<double>::toString().
* Remove declaration of unimplemented functions testAssertDoubleNotEquals1 and ↵Steve M. Robbins2007-01-272-2/+6
| | | | | | | | | | testAssertDoubleNotEquals2. * examples/cppunittest/TestAssertTest.cpp: * examples/cppunittest/TestAssertTest.h: Remove declaration of unimplemented functions testAssertDoubleNotEquals1 and testAssertDoubleNotEquals2. Factor new method testAssertDoubleNonFinite out of existing testAssertDoubleEquals.
* Add unit tests for CPPUNIT_ASSERT_DOUBLES_EQUAL() that test withSteve M. Robbins2007-01-271-0/+11
| | | | non-finite values.
* Arrange class initializers in correct order.Steve M. Robbins2007-01-124-10/+10
|
* Put a C++ statement in the first argument of CPPUNIT_ASSERT_THROW()Steve M. Robbins2007-01-121-4/+8
| | | | and CPPUNIT_ASSERT_NO_THROW().
* removed most warning when compiling with vc++ 6sp6.Baptiste Lepilleur2005-10-132-9/+12
|
* removed most warning when compiling with vc++ 6sp6.Baptiste Lepilleur2005-10-137-0/+7
|
* Include/cppunit/TestAssert.Baptiste Lepilleur2004-11-051-2/+2
| | | | | | | include/cppunit/TestAssert.h: * src/cppunit/TestAssert.cpp: integrated Neil Ferguson patch for missing _MESSAGE assertion variants. Also enhanced the failure message of a few assertions.
* Include/cppunit/Portability.Baptiste Lepilleur2004-06-251-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/Portability.h: moved OStringStream alias definition to Portability/Stream.h. User need to define EVC4 to indicate that config-evc4.h should be used. (how to we detect this automatically ?). Notes that this means it might be needed to add #include <string> to some headers since its no longer included by Portability.h. * include/cppunit/Portability/Stream.h: define alias OStringStream, stdCOut(), and OFileStream. If CPPUNIT_NO_STREAM is defined (evc4 config), then provides our own implementation (based on sprintf and fwrite). * include/cppunit/config/config-evc4.h: config file for embedded visual c++ 4. Still need to detect for this platform in Portability.h (currently relying on EVC4 being defined...) * *.[cpp/h]: most source files have been impacted with the following change: #include <iostream> -> #include <cppunit/Portability/Stream.h> std::ostream -> CPPUNIT_NS::OStream std::ofstream -> CPPUNIT_NS::OFileStream std::cout -> CPPUNIT_NS::stdCOut() std::endl -> "\n" Also, code using std::cin as been defined out if CPPUNIT_NO_STREAM was defined. The exact list of impact files can be obtain in CVS using tags: TG_CPPUNIT_NO_STREAM_BEFORE & TG_CPPUNIT_NO_STREAM_AFTER.
* Src/Baptiste Lepilleur2004-06-181-5/+5
| | | | src/*/*.dsp: bug #933154, post build fail in directory with spaces.
* fixing project compilation settings (rtti not always enabled)Baptiste Lepilleur2004-06-162-3/+3
|
* removed usage of std::exception ctor with a string (gcc 2.95 issue)Baptiste Lepilleur2004-03-131-6/+6
|
* Examples/cppunittest/TestAssertTest.Baptiste Lepilleur2004-03-134-56/+101
| | | | | | | | | | | | | | | examples/cppunittest/TestAssertTest.h: * examples/cppunittest/TestAssertTest.cpp: * examples/cppunittest/XmlUniformiserTest.h: * examples/cppunittest/XmlUniformiserTest.cpp: * include/cppunit/TestAssert.h: add the exception assertion macros from cppunit 2: CPPUNIT_ASSERT_THROW, CPPUNIT_ASSERT_NO_THROW, CPPUNIT_ASSERT_ASSERTION_FAIL, CPPUNIT_ASSERT_ASSERTION_PASS. Updated unit test to use and test the new macros. * include/cppunit/extensions/HelperMacros.h: deprecated the test case factory that check for exception (CPPUNIT_TEST_FAIL & CPPUNIT_TEST_EXCEPTION).
* added new linesBaptiste Lepilleur2003-05-072-2/+2
|
* Makefile.Baptiste Lepilleur2003-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | Makefile.am * configure.in * config/ac_dll.m4 * examples/cppunittest/Makefile.am * examples/hierarchy/Makefile.am * examples/money/Makefile.am * examples/simple/Makefile.am * include/cppunit/config/SelectDllLoader.h * include/cppunit/plugin/TestPlugIn.h * include/cppunit/tools/Algorithm.h * src/DllPlugInTester/Makefile.am * src/cppunit/Makefile.am * src/cppunit/TestDecorator.cpp * src/cppunit/ShlDynamicLibraryManager.cpp * src/cppunit/UnixDynamicLibraryManager.cpp * src/cppunit/Win32DynamicLibraryManager.cpp: applied patch from Abdessattar Sassi <abdesassi@users.sourceforge.net> to add support for plug-in to hp-ux.
* include/cppunit/extensions/TestSuiteBuilder.h: removed (unused)Baptiste Lepilleur2003-04-062-6/+6
|
* added missing project fileBaptiste Lepilleur2003-03-151-1/+1
|
* added missing project fileBaptiste Lepilleur2003-03-151-1/+1
|
* Include/cppunit/tools/Algorithm.Baptiste Lepilleur2003-03-153-3/+3
| | | | | | | | | | | | | | | | include/cppunit/tools/Algorithm.h: * examples/cppunittest/XmlOutputterTest.cpp: * examples/cppunittest/XmlUniformiser.*: * src/cppunit/CompilerOutputter.cpp: * src/cppunit/ProtectorChain.cpp: * src/cppunit/StringTools.cpp: * src/cppunit/TestPath.cpp: * src/cppunit/TypeInfoHelper.cpp: * src/cppunit/XmlElement.cpp: * src/cppunit/XmlOutputter.cpp: * src/DllPlugInTester/CommandLineParser.h: * src/msvc6/testrunner/TestRunnerDlg.cpp: switched to using unsigned index in loop to avoid signed/unsigned warning in vc7.
* Src/examples/cppunittest/TrackedTestCase.Baptiste Lepilleur2003-03-112-2/+2
| | | | | | | src/examples/cppunittest/TrackedTestCase.cpp: * src/examples/cppunittest/CppUnitTestMain.cpp: * src/examples/money/Money.h: partially applied patch #699794. Fixed compilation issues with Borland C++ 6.
* Src/cppunit/XmlElement.Baptiste Lepilleur2003-03-111-1/+4
| | | | | | src/cppunit/XmlElement.cpp: * src/examples/CppUnitTest/XmlUniformser.cpp: fixed bug #676505 (no space between attributes of XmlElement).
* Include/cppunit/plugin/DynamicLibraryManagerException.Baptiste Lepilleur2002-12-027-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/plugin/DynamicLibraryManagerException.h: added constructor to fix compilation issues on recents version of gcc and sun CC (bug #619059) * include/cppunit/input/XmlInputHelper.h: added. * include/cppunit/extensions/TestSuiteBuilderContext.h: * src/cppunit/TestSuiteBuilderContext.cpp: added addProperty() and getStringProperty(). Added macros CPPUNIT_TEST_SUITE_PROPERTY. * src/msvc6/testrunner/TestRunnerDlg.cpp: integrated Tim Threlkeld's bug fix #610162: browse button was disabled if history was empty. * src/msvc6/testrunner/DynamicWindow/cdxCSizeIconCtrl.cpp: integrated Tim Threlkeld's bug fix #610191: common control were not initialized. * include/cppunit/extensions/ExceptionTestCaseDecorator.h: bug #603172, missing Message construction. * src/cppunit/DefaultProtector.cpp: bug #603172. Fixed missing ';'. * src/cppunit/TestCase.cpp: bug #603671. Removed unguarded typeinfo include. * examples/cppunittests/*Suite.h: bug #603666. Added missing Portability.h include.
* Include/cppunit/Portability.Baptiste Lepilleur2002-08-282-40/+10
| | | | | | | | | | | | | | | | | | | | | include/cppunit/Portability.h: added CPPUNIT_STATIC_CAST. * include/cppunit/extensions/TestFixtureFactory.h: extracted from HelperMacros.h. Added template class ConcretTestFixtureFactory. * include/cppunit/extensions/TestSuiteBuilderContext.h: * src/cppunit/TestSuiteBuilderContext.cpp: added. Context used to add test case to the fixture suite. Prevent future compatibility break for custom test API. * include/cppunit/extensions/HelperMacros.h: mostly rewritten. No longer use TestSuiteBuilder. Added support for abstract test fixture through macro CPPUNIT_TEST_SUITE_END_ABSTRACT. Made custom test API easier to use. * examples/cppunittest/HelperMacrosTest.h: * examples/cppunittest/HelperMacrosTest.cpp: updated against HelperMacros.h changes.
* CodingGuideLines.Baptiste Lepilleur2002-08-277-1/+333
| | | | | | | | | | | | | | | | | | | | | | | | | CodingGuideLines.txt: updated for OS/390 C++ limitation. * examples/cppunittests/MockFunctor.h: added. Mock Functor to help testing. * examples/cppunittests/MockProtector.h: qdded. Mock Protector to help testing. * examples/cppunittests/TestResultTest.h * examples/cppunittests/TestResultTest.cpp: added tests for pushProtector(), popProtector() and protect(). * include/cppunit/TestAssert.h: removed default message value from assertEquals(). Caused compilation error on OS/390. * include/cppunit/plugin/PlugInParameters.h: * src/cppunit/PlugInParameters.cpp: renamed commandLine() to getCommandLine(). * src/msvc6/testrunner/TestRunnerDlg.h: * src/msvc6/testrunner/TestRunnerDlg.cpp: bug fix, disabled Browse button while running tests.
* Include/cppunit/Exception.Baptiste Lepilleur2002-08-0310-11/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/Exception.h: * src/cppunit/Exception.h: added setMessage(). * include/cppunit/Protector.h: * src/cppunit/Protector.cpp: added class ProtectorGuard. Change the reportXXX() method to support Exception passing and SourceLine. * include/cppunit/TestCaller.h: removed 'expect exception' features. It is now handled by ExceptionTestCaseDecorator and TestCaller no longer need default template argument support. * include/cppunit/TestCase.h: * include/cppunit/extensions/TestCaller.h: runTest() is now public instead of protected, so that it can be decorated. * include/cppunit/TestResult.h: * src/cppunit/TestResult.h: added pushProtector() and popProtector() methods. This allow user to specify their own exception trap when running test case. * include/cppunit/extensions/TestDecorator.h: * src/cppunit/TestDecorator.cpp: added. Extracted from TestDecorator.h. The test passed to the constructor is now owned by the decorator. * include/cppunit/extensions/TestCaseDecorator.h: * src/cppunit/TestCaseDecorator.cpp: added. Decorator for TestCase setUp(), tearDown() and runTest(). * include/cppunit/extensions/ExceptionTestCaseDecorator.h: added. TestCaseDecorator to expect that a specific exception is thrown. * include/cppunit/extensions/HelperMacros.h: updated against TestCaller change. * src/cppunit/DefaultFunctor.h: fixed bug (did not return underlying test return code). * src/cppunit/ProtectorChain.cpp: fixed bug in chaing return code. * src/cppunit/DefaultFunctor.h: fixed bug. * src/msvc6/testrunner/ActiveTest.h: * src/msvc6/testrunner/ActiveTest.cpp: updated against TestCaseDecorator ownership policy change. Moved inline functions to .cpp. * examples/cppunittest/TestSetUpTest.cpp: updated to use MockTestCase and against the new ownership policy. * examples/cppunittest/TestDecoratorTest.cpp: * examples/cppunittest/RepeatedTestTest.cpp: updated against TestDecorator ownership policy change. * examples/cppunittest/ExceptionTestCaseDecoratorTest.h: * examples/cppunittest/ExceptionTestCaseDecoratorTest.cpp: added. Unit tests for ExceptionTestCaseDecoratorTest.
* CodingGuideLines.Baptiste Lepilleur2002-07-1433-96/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CodingGuideLines.txt: added. CppUnit's coding guidelines for portability. * include/cppunit/portability/CppUnitStack.h: added. wrapper for std::stack. * include/cppunit/portability/CppUnitSet.h: added. wrapper for std::set. * include/cppunit/ui/text/TestRunner.h: fixed namespace definition for deprecated TestRunner. * include/cppunit/TestAssert.h: * src/cppunit/TestAssert.cpp: removed old deprecated functions that did not use SourceLine. Moved assertEquals() and assertDoubleEquals() into CppUnit namespace. * src/cppunit/TestFactoryRegistry.cpp: use CppUnitMap instead of std::map. * src/DllPlugInTester/CommandLineParser.h: use CppUnitDeque instead std::deque. * examples/cppunittest/*.h: * examples/cppunittest/*.cpp: removed all usage of CppUnitTest namespace. Everything is now in global space. * examples/*/*.h: * examples/*/*.cpp: replaced usage of CppUnit:: with CPPUNIT_NS::. * examples/ClockerPlugIn/ClockerModel.h: use CppUnit STL wrapper instead of STL container.
* Include/cppunit/ui/text/TestRunner.Baptiste Lepilleur2002-07-1344-397/+397
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* added missing filesBaptiste Lepilleur2002-07-111-1/+1
|
* Include/cppunit/extensions/AutoRegisterSuite.Baptiste Lepilleur2002-07-102-2/+3
| | | | | | | | | | | | | | | | | | | | | | | include/cppunit/extensions/AutoRegisterSuite.h: * include/cppunit/extensions/Orthodox.h: * include/cppunit/extensions/TestSuiteBuilder.h: * include/cppunit/extensions/TestSuiteFactory.h: * include/cppunit/TestCaller.h: * examples/hierarchy/BoardGameTest.h: * examples/hierarchy/ChessTest.h: replaced usage of 'typename' in template declaration with 'class'. * include/cppunit/ui/text/TestRunner.h: * src/cppunit/TextTestRunner.cpp: updated to use the generic TestRunner. Removed methods runTestByName() and runTest(). Inherits CppUnit::TestRunner. * include/cppunit/extensions/TestSuiteBuilder.h: removed templatized method addTestCallerForException(). It is no longer used since release 1.9.8. * examples/cppunittest/MockTestCase.h * examples/cppunittest/MockTestCase.cpp: removed the usage of 'mutable' keyword.
* Include/cppunit/XmlOutputter.Baptiste Lepilleur2002-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/XmlOutputter.h: fixed XmlOutputter constructed default value initializatino which caused compilation error with BC5. * src/cppunit/PlugInManager.cpp: added missing CPPUNIT_NO_TESTPLUGIN guard. * src/msvc6/testrunner/TestRunner.dsp: * src/msvc6/testrunner/TestRunner.rc: * src/msvc6/testrunner/TestRunnerDlg.cpp: * src/msvc6/testrunner/TestRunnerDlg.h: * src/msvc6/testrunner/TreeHierarchyDlg.cpp: * src/msvc6/testrunner/TreeHierarchyDlg.h: * src/msvc6/testpluginrunner/TestPlugInRunner.dsp: * src/msvc6/testpluginrunner/TestPlugInRunner.rc: * src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp: * src/msvc6/testpluginrunner/TestPlugInRunnerDlg.cpp: * src/msvc6/testpluginrunner/TestPlugInRunnerDlg.h: applied Steven Mitter patch to fix bug #530426 (conflict between TestRunner and host application resources). Adapted patch to compile work with Unicode. * src/msvc6/testrunner/ResourceLoaders.h: * src/msvc6/testrunner/ResourceLoaders.cpp: * src/msvc6/testrunner/Change-Diary-ResourceBugFix.txt: added, from Steven Mitter's patch. Simplified loadCString() to compile with Unicode. * src/cppunit/cppunit.dsp: * src/cppunit/cppunit_dll.dsp: * src/DllPlugInTester/DllPlugInTester.dsp: * src/msvc6/testrunner/TestRunner.dsp: * src/msvc6/testpluginrunner/TestPlugInRunner.dsp: all lib, dll and exe are now created in the intermediate directory. A post-build rule is used to copy them to the lib/ directory.
* examples/cppunittest/MessageTest.cpp: removed std::string() fromBaptiste Lepilleur2002-06-161-2/+4
| | | | assertion. Somehow gcc can't parse it. Added missing include <stdexcept>.
* Examples/cppunittest/MessageTest.Baptiste Lepilleur2002-06-162-0/+2
| | | | | examples/cppunittest/MessageTest.cpp: * examples/cppunittest/XmlElement.cpp: added missing include <stdexcept>.
* added ToolsSuite.hBaptiste Lepilleur2002-06-161-0/+1
|
* Release 1.Baptiste Lepilleur2002-06-167-28/+342
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | release 1.9.8 * include/cppunit/plugin/TestPlugIn.h: updated documentation. * include/cppunit/tools/XmlDocument.h: updated documentation. * include/cppunit/tools/StringTools.h: * src/cppunit/StringTools.cpp: added split() and wrap() functions. * include/cppunit/CompilerOutputter.h: * src/cppunit/CompilerOutputter.cpp: extracted wrap() and splitMessageIntoLines() to StringTools. * include/cppunit/XmlOutputterHook.h: * src/cppunit/XmlOutputterHook.cpp: removed rooNode parameter from beginDocument() and endDocument(). It can be retreive from document. Renamed 'node' occurences to 'element'. * include/cppunit/XmlOutputter.h: * src/cppunit/XmlOutputter.cpp: updated against XmlOutputterHook changes. Renamed 'node' occurences to 'element'. * examples/ClockerPlugIn/ClockerXmlHook.h: * examples/ClockerPlugIn/ClockerXmlHook.cpp: updated against XmlOutputterHook changes. * examples/cppunittest/XmlElementTest.h: * examples/cppunittest/XmlElementTest.cpp: Renamed 'node' occurences to 'element'. * examples/cppunittest/XmlOutputterTest.cpp: updated against XmlOutputterHook changes. * examples/cppunittest/StringToolsTest.h: * examples/cppunittest/StringToolsTest.cpp: added. Unit tests for StringTools. Turn out that VC++ dismiss empty lines in tools output, which is the reason why empty lines where not printed in CompilerOutputter.
* Include/cppunit/plugin/PlugInManager.Baptiste Lepilleur2002-06-144-3/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/plugin/PlugInManager.h: * src/cppunit/PlugInManager.cpp: added two methods to use the plug-in interface for Xml Outputter hooks. * include/cppunit/plugin/TestPlugIn.h: added two methods to the plug-in interface for Xml Outputter hooks. * include/cppunit/plugin/TestPlugInAdapter.h: * src/cppunit/plugin/TestPlugInAdapter.cpp: renamed TestPlugInDefaultImpl. Added empty implementation for Xml outputter hook methods. * include/cppunit/tools/StringTools.h: * src/cppunit/tools/StringTools.cpp: added. Functions to manipulate string (conversion, wrapping...) * include/cppunit/tools/XmlElement.h: * src/cppunit/XmlElement.cpp: renamed addNode() to addElement(). Added methods to walk and modify XmlElement (for hook). Added documentation. Use StringTools. * include/cppunit/XmlOutputter.h: * src/cppunit/XmlOutputter.cpp: added hook calls & management. * include/cppunit/XmlOutputterHook.h: * src/cppunit/XmlOutputterHook.cpp: added. Hook to customize XML output. * src/DllPlugInTester/DllPlugInTester.cpp: call plug-in XmlOutputterHook when writing XML output. Modified so that memory is freed before unloading the test plug-in (caused crash when freeing the XmlDocument). * examples/ReadMe.txt: * examples/ClockerPlugIn/ReadMe.txt: added details about the plug-in (usage, xml content...) * examples/ClockerPlugIn/ClockerModel.h: * examples/ClockerPlugIn/ClockerModel.cpp: extracted from ClockerListener. Represents the test hierarchy and tracked time for each test. * examples/ClockerPlugIn/ClockerListener.h: * examples/ClockerPlugIn/ClockerListener.cpp: extracted test hierarchy tracking to ClockerModel. Replaced the 'flat' view option with a 'text' option to print the timed test tree to stdout. * examples/ClockerPlugIn/ClockerPlugIn.cpp: updated to hook the XML output and use the new classes. * examples/ClockerPlugIn/ClockerXmlHook.h: * examples/ClockerPlugIn/ClockerXmlHook.cpp: added. XmlOutputterHook to includes the timed test hierarchy and test timing in the XML output. * examples/cppunittest/XmlElementTest.h: * examples/cppunittest/XmlElementTest.cpp: added new test cases. * examples/cppunittest/XmlOutputterTest.h: * examples/cppunittest/XmlOutputterTest.cpp: added tests for XmlOutputterHook.
* Include/cppunit/NotEqualException.Baptiste Lepilleur2002-06-139-174/+2
| | | | | | | | | | | | | | | | | | | | include/cppunit/NotEqualException.h: * src/cppunit/NotEqualException.cpp: removed. * include/cppunit/Exception.h: * src/cppunit/Exception.cpp: removed 'type' related stuffs. * include/cppunit/TextTestResult.h: * src/cppunit/TextTestResult.cpp: delegate printing to TextOutputter. * examples/simple/ExampleTestCase.h: * examples/simple/ExampleTestCase.cpp: reindented. * src/qttestrunner/build: * src/qttestrunner/qttestrunner.pro: * src/qttestrunner/TestBrowserDlgImpl.h: * src/qttestrunner/TestRunnerModel.h: applied Thomas Neidhart's patch, 'Some minor fixes to compile QTTestrunner under Linux.'.
* Include/cppunit/Asserter.Baptiste Lepilleur2002-06-1314-28/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/Asserter.h: * src/cppunit/Asserter.cpp: added functions that take a Message as a parameter. Existing function have a short description indicating an assertion failure. * include/cppunit/CompilerOuputter.h: * src/cppunit/CompilerOuputter.cpp: removed printNotEqualMessage() and printDefaultMessage(). Updated to use Message. * include/cppunit/Message.h: * src/cppunit/Message.cpp: added. Represents a message associated to an Exception. * include/cppunit/Exception.h: * src/cppunit/Exception.cpp: the message associated to the exception is now stored as a Message instead of a string. * include/cppunit/NotEqualException.cpp: constructs a Message instead of a string. * include/cppunit/TestAssert.h: * src/cppunit/TestAssert.cpp: updated to use Asserter functions that take a message when pertinent (CPPUNIT_FAIL...). * include/cppunit/TestCaller.h: * src/cppunit/TestCaller.cpp: exception not caught failure has a better short description. * src/cppunit/TestCase.cpp: better short description when setUp() or tearDown() fail. * src/msvc6/testrunner/TestRunnerDlg.cpp: replace '\n' in failure message with space. * examples/cppunittest/ExceptionTest.cpp: * examples/cppunittest/NotEqualExceptionTest.cpp: * examples/cppunittest/TestCallerTest.cpp: * examples/cppunittest/TestFailureTest.cpp: * examples/cppunittest/TestResultCollectorTest.h: * examples/cppunittest/TestResultCollectorTest.cpp: * examples/cppunittest/TestResultTest.cpp: * examples/cppunittest/XmlOutputterTest.h: * examples/cppunittest/XmlOutputterTest.cpp: updated to use Exception/Message. * examples/cppunittest/MessageTest.h: * examples/cppunittest/MessageTest.cpp: added. Unit test for Message.
* Install-unix: added some hints extracted from bug #544684 on how to compile ↵Baptiste Lepilleur2002-06-123-16/+113
| | | | | | | | | | | | | | | | | | | | | for Solaris/Forte C++ compiler. install-unix: added some hints extracted from bug #544684 on how to compile for Solaris/Forte C++ compiler. * TODO: cleaned-up and added new things. * include/cppunit/extensions/HelperMacros.h: CPPUNIT_TEST_SUITE now declares a class named ThisTestFixtureFactory which is a wrapper for the fixture factory. This removes the need to cast the fixture to the correct type when using the factory. Updated other macros implementation to use this new factory. Modified CPPUNIT_TEST_CUSTOM(S) macros to use this new factory class. Added macro CPPUNIT_TEST_ADD to help create new macros like CPPUNIT_TEST_xxx. * examples/cppunittest/HelperMacrosTest.h: * examples/cppunittest/HelperMacrosTest.cpp: added unit tests for CPPUNIT_TEST_CUSTOM, CPPUNIT_TEST_CUSTOMS and CPPUNIT_TEST_ADD.
* Include/cppunit/XmlOutputter.Baptiste Lepilleur2002-05-239-174/+294
| | | | | | | | | | | | | | | | | | | | | | | include/cppunit/XmlOutputter.h: * src/cppunit/XmlOutputter.cpp: extracted class XmlOutputter::Node to XmlElement. Extracted xml 'prolog' generation to XmlDocument. * include/cppunit/tools/XmlElement.h: * src/cppunit/tools/XmlElement.cpp: added, extracted from XmlOutputter::Node. * include/cppunit/tools/XmlDocument.h: * src/cppunit/tools/XmlDocument.cpp: added, extracted from XmlOutputter. Handle XML document prolog (encoding & style-sheet) and manage the root element. * src/DllPlugInTester/DllPlugInTester.cpp: bug fix, flag --xsl was ignored. * examples/cppunittest/XmlOutputterTest.h: * examples/cppunittest/XmlOutputterTest.cpp: updated for XmlOuputter changes. extracted tests for XmlOutputter::Node to XmlElementTest * examples/cppunittest/XmlElementTest.h: * examples/cppunittest/XmlElementTest.cpp: added, tests extracted from XmlOutputterTest.
* Contrib/bc5/bcc-makefile.Baptiste Lepilleur2002-04-217-22/+5
| | | | | | | | contrib/bc5/bcc-makefile.zip: updated, generic makefile for Borland 5.5, contributed by project cuppa. * examples/cppunittest/*Suite.h: integrated Jeffrey Morgan's patch, to remove warning with gcc.
* THANKS: updated Baptiste Lepilleur2002-04-206-28/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | THANKS: updated * src/cppunit/DynamicLibraryManager.cpp: bugfix: did not pass library name to exception. * include/cppunit/TestPath.h: * src/cppunit/TestPath.cpp: changed into value object. * src/cppunit/BeosDynamicLibraryManager.cpp: integrated patch from Shibu Yoshiki for BeOS ('cuppa' project team). * src/DllPlugInTester/CommandLineParser.h: * src/DllPlugInTester/CommandLineParser.cpp: added. Command line parsing. * src/DllPlugInTester/DllPlugInTester.cpp: full command line support with parameters for plug-ins. * src/DllPlugInTester/makefile.am: * examples/simple/makefile.am: * examples/cppunittest/makefile.am: integrated Jeffrey Morgan patch, Unix side should be working again. * examples/ReadMe.txt: added. Brief description of each example. * examples/cppunittest/CppUnitTestPlugIn.cpp: * examples/cppunittest/CppUnitTestPlugIn.dsp: added. New project to build CppUnit's test suite as a test plug-in. * examples/cppunittest/CppUnitTestSuite.cpp: updated. Use new helper macros to create the test suite hierarchy. * examples/simple/simple_plugin.opt: added. Contains debug tab settings. * examples/ClockerPlugIn/ClockerListener.cpp: * examples/ClockerPlugIn/ClockerListener.h: * examples/ClockerPlugIn/Timer.cpp: * examples/ClockerPlugIn/Timer.h: * examples/ClockerPlugIn/WinNtTimer.cpp: * examples/ClockerPlugIn/WinNtTimer.h: * examples/ClockerPlugIn/ClockerPlugIn.cpp: * examples/ClockerPlugIn/ClockerPlugIn.dsp: added. test listener plug-in that times tests. * examples/DumperPlugIn/DumperListener.cpp: * examples/DumperPlugIn/DumperListener.h: * examples/DumperPlugIn/DumperPlugIn.cpp: * examples/DumperPlugIn/DumperPlugIn.dsp: added. test listener plug-in that dump the test tree.