Salome HOME
refs #1341: debug of automatic tests
[modules/hydro.git] / src / HYDRO_tests / TestLib_Runner.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #pragma once
20
21 #include <cppunit/TestRunner.h>
22 #include <list>
23
24 #ifdef WIN32
25   #pragma warning( disable: 4251 )
26   #pragma warning( disable: 4275 )
27 #endif
28
29 /**
30   \class TestLib_Runner
31   \brief Implementation of the custom runner allowing start a subset of tests
32 */
33 class TestLib_Runner : public CPPUNIT_NS::TestRunner
34 {
35 public:
36   void Add( const std::string& theSubstr );
37   bool Load( const std::string& theConfigFile );
38   void Run( CPPUNIT_NS::TestResult& theController );
39
40 protected:
41   void GetTests( CPPUNIT_NS::Test* theRoot, std::list<std::string>& theAllowedTests ) const;
42   bool IsAllowed( const std::string& theTestName ) const;
43
44 private:
45   std::list<std::string> mySubStrings; ///< the list of substring patterns 
46 };
47
48 #ifdef WIN32
49   #pragma warning( default: 4251 )
50   #pragma warning( default: 4275 )
51 #endif
52