[Mockpp-commits] mockpp/mockpp/framework CxxTestRunner.h,NONE,1.1
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-12-10 21:57:20
|
Update of /cvsroot/mockpp/mockpp/mockpp/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27304/mockpp/framework Added Files: CxxTestRunner.h Log Message: new --- NEW FILE: CxxTestRunner.h --- /** @file @brief Run tests based on CxxTest::TestRunner $Id: CxxTestRunner.h,v 1.1 2005/12/10 21:57:12 ewald-arnold Exp $ ***************************************************************************/ /************************************************************************** begin : Sat Dec 10 2005 copyright : (C) 2002-2005 by Ewald Arnold email : mockpp at ewald-arnold dot de This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. **/ #ifndef MOCKPP_CXXTESTRUNNER_H #define MOCKPP_CXXTESTRUNNER_H #include <mockpp/mockpp.h> // always first #if defined(HAVE_CXXTEST) #include <mockpp/compat/Exception.h> #include <cxxtest/TestRunner.h> namespace mockpp { class CxxTestRunner : public CxxTest::TestRunner { public: static void runAllTests( CxxTest::TestListener &listener ) { CxxTest::tracker().setListener( &listener ); _TS_TRY { CxxTestRunner().runWorld(); } _TS_CATCH_TYPE( (mockpp::Exception &ex), {CxxTest::tracker().failedTest( mockpp::getLatin1(ex.getSrcFile()).c_str(), ex.getSrcLine(), mockpp::getLatin1(ex.getMessage()).c_str() ); } ) _TS_CATCH_TYPE( (std::exception &ex), {CxxTest::tracker().failedTest( __FILE__, __LINE__, ex.what() ); } ) _TS_LAST_CATCH( { CxxTest::tracker().failedTest( __FILE__, __LINE__, "Exception thrown from world" ); } ); CxxTest::tracker().setListener( 0 ); } }; } // namespace mockpp #endif // HAVE_CXXTEST #endif // MOCKPP_CXXTESTRUNNER_H |