summaryrefslogtreecommitdiff
path: root/examples/cppunittest/TestResultTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* CodingGuideLines.Baptiste Lepilleur2002-08-271-1/+106
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* CodingGuideLines.Baptiste Lepilleur2002-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Include/cppunit/Asserter.Baptiste Lepilleur2002-06-131-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Bumped version to 1.Baptiste Lepilleur2002-04-171-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bumped version to 1.9.3 * FAQ: added question about 4786 warning on VC++. * NEWS: updated. * contrib/msvc/readme.txt: moved to contrib/readme.txt. * contrib/xml-xsl/report.xsl: added XML style sheet contributed by 'cuppa' project team (http://sourceforge.jp/projects/cuppa/) * examples/cppunittest/TestResultTest.h: * examples/cppunittest/TestResultTest.cpp: added tests for startTestRun()/endTestRun(). * examples/simple/*: added. A simple example. * include/cppunit/BriefTestProgressListener.h: * src/cppunit/BriefTestProgressListener.cpp: added. Verbose progess listener that print the test name before running the test. * include/cppunit/TestListener.h: added startTestRun()/endTestRun(). * include/cppunit/TestResult.h: * src/cppunit/TestResult.cpp: added runTest(), to be called to run a test by test runner. * src/cppunit/TextTestRunner.cpp: * src/cppunit/TestRunner.cpp: updated to use TestResult::runTest(). * include/cppunit/plugin/PlugInManager.h: * src/cppunit/PlugInManager.cpp: added. Managers for all loaded plug-ins. * include/cppunit/plugin/TestPlugInDefaultImpl.h: * src/cppunit/TestPlugInDefaultImpl.cpp: renamed TestPlugInAdapter. All implementations are empty. * include/cppunit/plugin/TestPlugInSuite.h: removed. * src/cppunit/TestPlugInSuite.cpp: removed. Replaced by PlugInManager. * include/cppunit/plugin/TestPlugIn.h: rewrote the plug-in interface to provide more versatility. updated macros to match new interface. * include/cppunit/extensions/TestFactoryRegistry.h: * include/cppunit/extensions/TestFactoryRegistry.cpp: Added unregisterFactory(). Added convenience method addRegistry(). Rewrote registry life cycle management. AutoRegisterSuite can now detect that the registry has been destroy and not call to it to unregister its test factory. * include/cppunit/extensions/AutoRegisterTest.h: on destruction, the registered factory is unregistered from the registry. * include/cppunit/extensions/HelperMacros.h: added macros CPPUNIT_REGISTRY_ADD_TO_DEFAULT and CPPUNIT_REGISTRY_ADD to help build test suite hierarchy. * src/cppunit/msvc/DllPlugInTester/*: moved to src/cppunit/DllPlugInTester/. * src/cppunit/DllPlugInTester/DllPlugInTester.cpp: removed UNICODE stuffs. Use the PlugInManager instead of PlugInTestSuite. Simplified: only one test on command line, but many DLL can be specified. Added configurations to link against cppunit dll, those are now the default configuration (static linking don't make much sense for plug-in).
* Include/cppunit/CompilerOutputter.Baptiste Lepilleur2002-04-121-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/CompilerOutputter.h: * src/cppunit/CompilerOutputter.h: deprecated defaultOuputter(). Added setLocationFormat() and format specifiation in constructor. A string that represent the location format is used to output the location. Default format is defined by CPPUNIT_COMPILER_LOCATION_FORMAT. * include/cppunit/config-msvc6.h: * include/cppunit/Portability.h: added CPPUNIT_COMPILER_LOCATION_FORMAT. Use gcc location format if VC++ is not detected. * include/cppunit/Test.h: fixed documentation. * include/cppunit/TestListener.h: added startSuite() and endSuite() callbacks. Added new example to documentation. * include/cppunit/TestResult.h: * src/cppunit/TestResult.cpp: * include/cppunit/TestComposite.h: * src/cppunit/TestComposite.cpp: Updated to inform the listeners. * src/qttestrunner/TestBrowserDlgImpl.cpp: used Test new composite interface instead of RTTI to explore the test hierarchy. * examples/cppunittest/MockTestListener.h: * examples/cppunittest/MockTestListener.cpp: updated,added support for startSuite() and endSuite(). * examples/cppunittest/TestResultTest.h: * examples/cppunittest/TestResultTest.cpp: added tests for startSuite() and endSuite().
* NEW: updated and restructured.Baptiste Lepilleur2002-02-281-229/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NEW: updated and restructured. * include/cppunit/CompilerOutputter.h: * src/cppunit/CompilerOutputter.cpp: updated against TestResultChange. Changed TestResult to TestResultCollector. * include/cppunit/extensions/HelperMacros.h: minor documentation fix. * include/cppunit/Outputter.h: added. Abstract base class for all Outputter. * include/cppunit/Portability.h: made the fix on OStringStream suggested by Bob Summerwill to remove level 4 warning with VC++. * include/cppunit/TestAssert.h: added macro CPPUNIT_ASSERT_EQUAL_MESSAGE. * src/cppunit/TestFailure.cpp: * include/cppunit/TestFailure.h: added method clone() to duplicate a failure. Made all method virtual. * include/cppunit/TestListener.h: changed signature of addFailure() to addFailure( const TestFailure &failure ). Failure is now only a temporary object. * include/cppunit/Outputter.h: added. Abstract base class for all outputter. Used by TextTestRunner. * include/cppunit/SynchronizedObject.h: * src/cppunit/SynchronizedObject.cpp: added. Class extracted from TestResult. Base class for objects that can be accessed from different threads. * include/cppunit/TestResult.h: TestFailure.h is no longer included. * include/cppunit/TestResult.h: * src/cppunit/TestResult.cpp: extracted all methods related to keeping track of the result to the new TestResultCollector class which is a TestListener. * include/cppunit/TestResultCollector.h: * src/cppunit/TestResultCollector.cpp: added. TestListener which kept track of the result of the test run. All failure/error, and tests are tracked. * include/cppunit/TestSucessListener.h: * src/cppunit/TestSucessListener.cpp: added. TestListener extracted from TestResult. Is responsible for wasSucessful(). * include/cppunit/TestCase.h: * src/cppunit/TestCase.cpp: reindented. * include/cppunit/TextOutputter.h: * src/cppunit/TextOutputter.cpp: added. Copied from the deprecated TextTestResult and modified to act as an Ouputter. * include/cppunit/TextTestProgressListener.h: * src/cppunit/TextTestProgressListener.cpp: Copied from the deprecated TextTestResult and modified to print the dot while the test are running. * include/cppunit/TextTestResult.h: * src/cppunit/TextTestResult.cpp: updated against TestResult change. No compatiblity break. Deprecated. * include/cppunit/TextTestRunner.h: * src/cppunit/TextTestRunner.cpp: updated to work with the new TestResult. Use TextTestProgressListener and TextOutputter instead of TextTestResult. Any outputter with interface Outputter can be used to print the test result (CompilerOutputter, XmlOutputter, TextOutputter...) * include/cppunit/XmlOutputter.h: * src/cppunit/XmlOutputter.cpp: updated against TestResultChange. Changed TestResult to TestResultCollector. * src/msvc6/TestRunnerDlg.h: * src/msvc6/TestRunnerDlg.cpp: fixed the 'fullrowselect' feature of the list view. The dialog is a TestListener itself, it no longer use the GUITestResult class. * src/msvc6/TestRunner.rc: moved the "autorun test button" in such a way that it did not overlap the progress bar anymore. * src/msvc6/MfcSynchronizationObject.h: added. Generic SynchronizedObject lock for MFC. * src/msvc6/GUITestResult.h : * src/msvc6/GUITestResult.cpp : removed. * src/qttestrunner/TestRunnerModel.h: * src/qttestrunner/TestRunnerModel.cpp: changed addFailure() signature to reflect change on TestListener. * examples/cppunittest/CppUnitTestMain.cpp: updated to use the new Outputter abstraction and TextTestRunner facilities. * examples/cppunittest/FailingTestCase.h: * examples/cppunittest/FailingTestCase.cpp: removed. Replaced by MockTestCase. * examples/cppunittest/FailingTestCase.h: * examples/cppunittest/FailingTestCase.h: * examples/cppunittest/HelperMacrosTest.h: * examples/cppunittest/HelperMacrosTest.cpp: Updated against TestResult change. Use MockTestListener instead of TestResult to check for sucess or failure. * examples/cppunittest/MockTestListener.h: * examples/cppunittest/MockTestListener.cpp: the class now behave like a mock object. * examples/cppunittest/MockTestCase.h: * examples/cppunittest/MockTestCase.cpp: added. Mock TestCase object. * examples/cppunittest/OrthodoxTest.h: * examples/cppunittest/OrthodoxTest.cpp: Updated against TestResult change. Use MockTestListener instead of TestResult to check for sucess or failure. * examples/cppunittest/SynchronizedTestResult.h: Updated against TestResult change. * examples/cppunittest/TestCallerTest.h: * examples/cppunittest/TestCallerTest.cpp: Updated against TestResult change. Use MockTestListener instead of TestResult. * examples/cppunittest/TestCaseTest.h: * examples/cppunittest/TestCaseTest.cpp: Updated against TestResult change. Use MockTestListener and MockTestCase instead of FailingTestCase and TestResult. * examples/cppunittest/TestDecoratorTest.h: * examples/cppunittest/TestDecoratorTest.cpp: Updated against TestResult change. Use MockTestCase instead of FailingTestCase. * examples/cppunittest/TestListenerTest.h: * examples/cppunittest/TestListenerTest.cpp: removed. Those unit tests have been rewrote and moved to TestResultTest. * examples/cppunittest/TestResultTest.h: * examples/cppunittest/TestResultTest.cpp: Updated to test the new interface. Tests from TestListenerTest have been moved here. * examples/cppunittest/TestResultCollectorTest.h: * examples/cppunittest/TestResultCollectorTest.cpp: added. Tests for the class that been extracted from TestResult. * examples/cppunittest/TestSetUpTest.h: * examples/cppunittest/TestSetUpTest.cpp: renamed SetUp inner class to MockSetUp. Changed interface to be more akin to a Mock object. * examples/cppunittest/TestSuiteTest.h: * examples/cppunittest/TestSuiteTest.cpp: Updated against TestResult change, and rewrote to use MockTestCase instead of FailingTestCase. * examples/cppunittest/XmlOutputterTest.h: * examples/cppunittest/XmlOutputterTest.cpp: Updated against TestResult change. Added some utility methods to make the update easier.
* Include/cppunit/TestFailure.Baptiste Lepilleur2001-10-031-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/TestFailure.cpp : * include/cppunit/TestFailure.h : fixed some constness issues. Added argument to indicate the type of failure to constructor. Added isError(). * include/cppunit/TestListener.h : removed addError(). addFailure() now take a TestFailure as argument. * include/cppunit/TestResult.h : * include/cppunit/TestResult.cpp : removed errors(). Refactored. Fixed some constness issues. Added typedef TestFailures for vector returned by failures(). failures() returns a const reference on the list of failure. added testFailuresTotal(). Constructor can take an optional synchronization object. * include/cppunit/TextTestResult.h : * include/cppunit/TextTestResult.cpp : removed printErrors(). Refactored. Updated to suit new TestResult, errors and failures are reported in the same list. * examples/cppunittest/TestFailureTest.cpp : * examples/cppunittest/TestFailureTest.h : modified to use the new TestFailure constructor. Added one test. * examples/cppunittest/TestListenerTest.cpp: removed addError(). Refactored to suit new TestListener. * examples/cppunittest/TestResultTest.h : * examples/cppunittest/TestResultTest.cpp : modified to suit the new TestResult.
* Include/cppunit/extensions/TestFactoryRegistry.Baptiste Lepilleur2001-10-021-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/cppunit/extensions/TestFactoryRegistry.h * src/cppunit/TestFactoryRegistry.cpp : fixed memory leaks that occured when a TestFactoryRegistry was registered into another TestFactoryRegistry. * include/cppunit/extensions/AutoRegisterSuite.h : updated doc. * include/cppunit/extensions/HelperMacros.h : added macro CPPUNIT_TEST_SUITE_NAMED_REGISTRATION to register a suite into a named suite. Updated doc. * examples/cppunittest/CoreSuite.h: * examples/cppunittest/ExtensionSuite.h: * examples/cppunittest/HelperSuite.h: added, declaration of suite for use with CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/makefile.am : added HelperSuite.h, CoreSuite.h, ExtensionSuite.h, CppUnitTestSuite.h and CppUnitTestSuite.cpp. * examples/cppunittest/CppUnitTestSuite.*: added. * examples/cppunittest/ExceptionTest.cpp: * examples/cppunittest/TestAssertTest.cpp: * examples/cppunittest/TestCaseTest.cpp: * examples/cppunittest/TestFailureTest.cpp: * examples/cppunittest/TestListenerTest.cpp: * examples/cppunittest/TestResultTest.cpp: * examples/cppunittest/TestSuiteTest.cpp: moved into named suite "Core" using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/OrthodoxTest.cpp: * examples/cppunittest/RepeatedTest.cpp: * examples/cppunittest/TestDecoratorTest.cpp: * examples/cppunittest/TestSetUpTest.cpp: moved into named suite "Extension" using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/HelperMacrosTest.cpp: * examples/cppunittest/TestCallerTest.cpp: moved into named suite "Helper" using CPPUNIT_TEST_SUITE_NAMED_REGISTRATION. * examples/cppunittest/CppUnitTest.dsp : * examples/msvc6/CppUnitTestApp/CppUnitTestApp.dsp : added Makefile.am, HelperSuite.h, CoreSuite.h, ExtensionSuite.h, CppUnitTestSuite.h and CppUnitTestSuite.cpp.
* Fixes for test suiteSteve M. Robbins2001-06-111-4/+4
|
* Examples/cppunittest/TestResultTest.Baptiste Lepilleur2001-06-111-0/+305
| | | | examples/cppunittest/TestResultTest.*: renamed TestListenerTest.*
* Examples/cppunittest/TestResultTest.Baptiste Lepilleur2001-06-111-189/+0
| | | | | | | | | examples/cppunittest/TestResultTest.*: renamed TestListenerTest.* * examples/cppunittest/*: added unit tests for: HelperMacros, TestAssert, TestCaller, TestCase, TestFailure, TestResult, TestSuite, TestDecoratorTest, TestSetUp, RepeatedTestTest, Orthodox, Exception.
* Change to templatized TestAssert::assertEquals() and the new CPPUNIT_ASSERT* ↵Steve M. Robbins2001-06-021-16/+16
| | | | macros
* Replace CU_ by CPPUNIT_.Steve M. Robbins2001-06-021-1/+1
|
* (suite): fixed 'ISO C++ forbids taking the address of a bound member ↵Bastiaan Bakker2001-06-011-9/+15
| | | | | | function to form a pointer to member function' bug reported by g++. (suite): removed dependency on RTTI.
* Added project cppunittest to examples/: unit tests to test cppunit.Baptiste Lepilleur2001-06-011-0/+183
added project cppunittest to examples/: unit tests to test cppunit. The main file is CppUnitTestMain.cpp. Unit tests have been implemented for TestCaller and TestListener. * added project CppUnitTestApp to examples/msvc6: graphical runner for cppunittest. * added TestListener to TestResult. It is a port of junit TestListener. * updated some .cvsignore to ignore files generated with VC++.