[Cppunit-cvs] cppunit2/include/cpput lighttestrunner.h,NONE,1.1 testinfo.h,1.9,1.10 testrunner.h,1.3
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2005-07-02 20:27:48
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14915/include/cpput Modified Files: testinfo.h testrunner.h Added Files: lighttestrunner.h Log Message: * Added a simple test runner that does not rely on the open test framework to run cppunit2 tests. * added CppTL::ConstCharView to wrapper const char *strings. * added CppTL::quoteMultiLineString() * string assertion output actual and expected using quoteMultiLineString(). * added serialize unit test for basic Properties * opentest tests now use the LightTestRunner. Index: testinfo.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testinfo.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testinfo.h 1 Mar 2005 19:36:51 -0000 1.9 --- testinfo.h 2 Jul 2005 20:27:35 -0000 1.10 *************** *** 58,62 **** }; ! void CPPUT_API setTestResultUpdater( const TestResultUpdaterPtr &updater ); void CPPUT_API startNewTest(); --- 58,62 ---- }; ! void CPPUT_API setTestResultUpdater( TestResultUpdater &updater ); void CPPUT_API startNewTest(); Index: testrunner.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testrunner.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testrunner.h 21 Nov 2004 22:24:45 -0000 1.3 --- testrunner.h 2 Jul 2005 20:27:35 -0000 1.4 *************** *** 37,40 **** --- 37,41 ---- AbstractTestSuitePtr suite_; DeclaredTests tests_; + TestResultUpdaterImplPtr resultUpdater_; }; --- NEW FILE: lighttestrunner.h --- #ifndef CPPUT_LIGHTTESTRUNNER_H_INCLUDED # define CPPUT_LIGHTTESTRUNNER_H_INCLUDED # include <cpput/forwards.h> # include <cpput/testinfo.h> # include <deque> namespace CppUT { /* Lightweight test runner intended for unit testing CppUnit itself * and the open test framework. */ class LightTestRunner : private TestResultUpdater { public: LightTestRunner(); virtual ~LightTestRunner(); void addTest( const TestPtr &test ); bool runAllTests(); private: // overridden from TestResultUpdater virtual void mergeInResult( const OpenTest::Properties &result ); virtual void mergeInResult( const OpenTest::PropertyPath &path, const OpenTest::Value &value ); virtual void appendToResult( const OpenTest::PropertyPath &path, const OpenTest::Value &value ); private: void runTest( const TestPtr &test ); void runTestSuite( const TestSuitePtr &suite ); void runTestCase( const AbstractTestCasePtr &testCase ); CppTL::ConstString getTestPath() const; void reportFailure( const OpenTest::Properties &failure, bool isAssertion ); typedef std::deque<TestPtr> Tests; Tests tests_; typedef std::deque<CppTL::ConstString> TestPath; TestPath testPath_; CppTL::StringBuffer report_; OpenTest::Properties result_; unsigned int testRun_; unsigned int testFailed_; }; } // namespace CppUT #endif // CPPUT_LIGHTTESTRUNNER_H_INCLUDED |