00001 #ifndef CPPUNIT_TESTPATH_H
00002 #define CPPUNIT_TESTPATH_H
00003
00004 #include <cppunit/Portability.h>
00005
00006 #if CPPUNIT_NEED_DLL_DECL
00007 #pragma warning( push )
00008 #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
00009 #endif
00010
00011 #include <cppunit/portability/CppUnitDeque.h>
00012
00013 CPPUNIT_NS_BEGIN
00014
00015
00016 class Test;
00017
00018 #if CPPUNIT_NEED_DLL_DECL
00019
00020 #endif
00021
00022
00033 class CPPUNIT_API TestPath
00034 {
00035 public:
00040 TestPath();
00041
00046 TestPath( Test *root );
00047
00055 TestPath( const TestPath &otherPath,
00056 int indexFirst,
00057 int count = -1 );
00058
00074 TestPath( Test *searchRoot,
00075 const std::string &pathAsString );
00076
00080 TestPath( const TestPath &other );
00081
00082 virtual ~TestPath();
00083
00087 virtual bool isValid() const;
00088
00092 virtual void add( Test *test );
00093
00097 virtual void add( const TestPath &path );
00098
00104 virtual void insert( Test *test, int index );
00105
00112 virtual void insert( const TestPath &path, int index );
00113
00118 virtual void removeTests();
00119
00124 virtual void removeTest( int index );
00125
00130 virtual void up();
00131
00135 virtual int getTestCount() const;
00136
00142 virtual Test *getTestAt( int index ) const;
00143
00148 virtual Test *getChildTest() const;
00149
00160 virtual std::string toString() const;
00161
00166 TestPath &operator =( const TestPath &other );
00167
00168 protected:
00173 void checkIndexValid( int index ) const;
00174
00176 typedef CppUnitDeque<std::string> PathTestNames;
00177
00184 bool splitPathString( const std::string &pathAsString,
00185 PathTestNames &testNames );
00186
00196 Test *findActualRoot( Test *searchRoot,
00197 const std::string &pathAsString,
00198 PathTestNames &testNames );
00199
00200 protected:
00201 typedef CppUnitDeque<Test *> Tests;
00202 Tests m_tests;
00203
00204 };
00205
00206
00207 CPPUNIT_NS_END
00208
00209 #endif // CPPUNIT_TESTPATH_H
00210