CppUnit project page | FAQ

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

TestPath.h
Go to the documentation of this file.
1 #ifndef CPPUNIT_TESTPATH_H
2 #define CPPUNIT_TESTPATH_H
3
4 #include <cppunit/Portability.h>
5
6 #if CPPUNIT_NEED_DLL_DECL
7 #pragma warning( push )
8 #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
9 #endif
10
11 #include <cppunit/portability/CppUnitDeque.h>
12 #include <string>
13
14 CPPUNIT_NS_BEGIN
15
16
17 class Test;
18
19 #if CPPUNIT_NEED_DLL_DECL
20 // template class CPPUNIT_API std::deque<Test *>;
21 #endif
22
23
34 class CPPUNIT_API TestPath
35 {
36 public:
41 TestPath();
42
47 TestPath( Test *root );
48
56 TestPath( const TestPath &otherPath,
57 int indexFirst,
58 int count = -1 );
59
75 TestPath( Test *searchRoot,
76 const std::string &pathAsString );
77
81 TestPath( const TestPath &other );
82
83 virtual ~TestPath();
84
88 virtual bool isValid() const;
89
93 virtual void add( Test *test );
94
98 virtual void add( const TestPath &path );
99
105 virtual void insert( Test *test, int index );
106
113 virtual void insert( const TestPath &path, int index );
114
119 virtual void removeTests();
120
125 virtual void removeTest( int index );
126
131 virtual void up();
132
136 virtual int getTestCount() const;
137
143 virtual Test *getTestAt( int index ) const;
144
149 virtual Test *getChildTest() const;
150
161 virtual std::string toString() const;
162
167 TestPath &operator =( const TestPath &other );
168
169 protected:
174 void checkIndexValid( int index ) const;
175
177 typedef CppUnitDeque<std::string> PathTestNames;
178
185 bool splitPathString( const std::string &pathAsString,
186 PathTestNames &testNames );
187
197 Test *findActualRoot( Test *searchRoot,
198 const std::string &pathAsString,
199 PathTestNames &testNames );
200
201 protected:
202 typedef CppUnitDeque<Test *> Tests;
203 Tests m_tests;
204
205 };
206
207
208 CPPUNIT_NS_END
209
210 #endif // CPPUNIT_TESTPATH_H
211
Portability.h
Test
Base class for all test objects.All test objects should be a subclass of Test. Some test objects...
Definition: Test.h:25
CPPUNIT_NS_END
#define CPPUNIT_NS_END
Definition: Portability.h:120
CPPUNIT_NS_BEGIN
#define CPPUNIT_NS_BEGIN
Definition: Portability.h:119
TestPath
A List of Test representing a path to access a Test.The path can be converted to a string and resolve...
Definition: TestPath.h:34
TestPath::PathTestNames
CppUnitDeque< std::string > PathTestNames
A list of test names.
Definition: TestPath.h:177
TestPath::m_tests
Tests m_tests
Definition: TestPath.h:203
CppUnitDeque.h
TestPath::Tests
CppUnitDeque< Test * > Tests
Definition: TestPath.h:202
CPPUNIT_API
#define CPPUNIT_API
Definition: CppUnitApi.h:27

| Send comments to: CppUnit Developers