|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This file contains the header file of the |
|
15 * CTestModuleInfo class. The class was created to keep module names, |
|
16 * ini files and test case configuration files. |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef TESTMODULEINFO_H |
|
21 #define TESTMODULEINFO_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <StifLogger.h> |
|
26 |
|
27 // CONSTANTS |
|
28 // None |
|
29 |
|
30 // MACROS |
|
31 // None |
|
32 |
|
33 // DATA TYPES |
|
34 // None |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 // None |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 // None |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 // DESCRIPTION |
|
45 // Class with information about configuration (test case) file. |
|
46 class CTestCaseFileInfo |
|
47 :public CBase |
|
48 { |
|
49 public: // Enumerations |
|
50 |
|
51 private: // Enumerations |
|
52 |
|
53 public: // Constructors and destructor |
|
54 /** |
|
55 * NewL. |
|
56 */ |
|
57 static CTestCaseFileInfo* NewL(TDesC& aCfgFileName, CStifLogger* aLogger); |
|
58 |
|
59 /** |
|
60 * C++ destructor. |
|
61 */ |
|
62 virtual ~CTestCaseFileInfo(); |
|
63 |
|
64 private: // Constructors and destructor |
|
65 /** |
|
66 * C++ constructor. |
|
67 */ |
|
68 CTestCaseFileInfo(); |
|
69 |
|
70 /** |
|
71 * By default Symbian OS constructor is private. |
|
72 */ |
|
73 void ConstructL(TDesC& aCfgFileName, CStifLogger* aLogger); |
|
74 |
|
75 public: // New functions |
|
76 /** |
|
77 * Set configuration file as already checked. |
|
78 */ |
|
79 IMPORT_C void SetChecked(void); |
|
80 |
|
81 /** |
|
82 * Return if config file has been checked. |
|
83 */ |
|
84 TBool IsChecked(void); |
|
85 |
|
86 /** |
|
87 * Get module name. |
|
88 */ |
|
89 IMPORT_C TInt GetCfgFileName(TDes& aCfgFileName); |
|
90 |
|
91 |
|
92 |
|
93 protected: // New functions |
|
94 |
|
95 private: // New functions |
|
96 |
|
97 public: // Data |
|
98 |
|
99 protected: // Data |
|
100 |
|
101 private: // Data |
|
102 //Config file name |
|
103 HBufC* iCfgFileName; |
|
104 |
|
105 //Was checked |
|
106 TBool iChecked; |
|
107 |
|
108 // Logger instance |
|
109 CStifLogger* iLogger; |
|
110 |
|
111 public: // Friend classes |
|
112 |
|
113 protected: // Friend classes |
|
114 |
|
115 private: // Friend classes |
|
116 }; |
|
117 |
|
118 // DESCRIPTION |
|
119 // Class with information about test modules. |
|
120 class CTestModuleInfo |
|
121 :public CBase |
|
122 { |
|
123 public: // Enumerations |
|
124 |
|
125 private: // Enumerations |
|
126 |
|
127 public: // Constructors and destructor |
|
128 /** |
|
129 * NewL. |
|
130 */ |
|
131 static CTestModuleInfo* NewL(TDesC& aModuleName, CStifLogger* aLogger); |
|
132 |
|
133 /** |
|
134 * C++ destructor. |
|
135 */ |
|
136 virtual ~CTestModuleInfo(); |
|
137 |
|
138 private: // Constructors and destructor |
|
139 /** |
|
140 * C++ constructor. |
|
141 */ |
|
142 CTestModuleInfo(); |
|
143 |
|
144 /** |
|
145 * By default Symbian OS constructor is private. |
|
146 */ |
|
147 void ConstructL(TDesC& aModuleName, CStifLogger* aLogger); |
|
148 |
|
149 public: // New functions |
|
150 /** |
|
151 * Set initialization file name. |
|
152 */ |
|
153 IMPORT_C TInt SetIniFile(TDesC& aIniFileName); |
|
154 |
|
155 /** |
|
156 * Add configuration (test case) file name to array. |
|
157 */ |
|
158 IMPORT_C TInt AddCfgFile(TDesC& aCfgFileName); |
|
159 |
|
160 /** |
|
161 * Get number of test case files. |
|
162 */ |
|
163 IMPORT_C TInt CountCfgFiles(void); |
|
164 |
|
165 /** |
|
166 * Get module name. |
|
167 */ |
|
168 IMPORT_C TInt GetModuleName(TDes& aModuleName); |
|
169 |
|
170 /** |
|
171 * Get ini file. |
|
172 */ |
|
173 IMPORT_C TInt GetIniFileName(TDes& aIniFileName); |
|
174 |
|
175 /** |
|
176 * Get cfg file. |
|
177 */ |
|
178 IMPORT_C TInt GetCfgFileName(TInt aIndex, TDes& aCfgFileName); |
|
179 |
|
180 /** |
|
181 * Get first unchecked config file. |
|
182 */ |
|
183 CTestCaseFileInfo* GetUncheckedCfgFile(void); |
|
184 |
|
185 protected: // New functions |
|
186 |
|
187 private: // New functions |
|
188 |
|
189 public: // Data |
|
190 |
|
191 protected: // Data |
|
192 |
|
193 private: // Data |
|
194 //Module name |
|
195 HBufC* iModuleName; |
|
196 |
|
197 //Initialization file |
|
198 HBufC* iIniFileName; |
|
199 |
|
200 //Array of cfg files |
|
201 RPointerArray<CTestCaseFileInfo> iCfgFiles; |
|
202 |
|
203 // Logger instance |
|
204 CStifLogger* iLogger; |
|
205 |
|
206 public: // Friend classes |
|
207 |
|
208 protected: // Friend classes |
|
209 |
|
210 private: // Friend classes |
|
211 }; |
|
212 |
|
213 // DESCRIPTION |
|
214 // Class with list of test modules. |
|
215 class CTestModuleList |
|
216 :public CBase |
|
217 { |
|
218 public: // Enumerations |
|
219 |
|
220 private: // Enumerations |
|
221 |
|
222 public: // Constructors and destructor |
|
223 /** |
|
224 * NewL. |
|
225 */ |
|
226 IMPORT_C static CTestModuleList* NewL(CStifLogger* aLogger); |
|
227 |
|
228 /** |
|
229 * C++ destructor. |
|
230 */ |
|
231 IMPORT_C virtual ~CTestModuleList(); |
|
232 |
|
233 private: // Constructors and destructor |
|
234 /** |
|
235 * C++ constructor. |
|
236 */ |
|
237 CTestModuleList(); |
|
238 |
|
239 /** |
|
240 * By default Symbian OS constructor is private. |
|
241 */ |
|
242 void ConstructL(CStifLogger* aLogger); |
|
243 |
|
244 public: // New functions |
|
245 /** |
|
246 * Add test module to list. |
|
247 */ |
|
248 IMPORT_C TInt AddTestModule(TDesC& aModuleName); |
|
249 |
|
250 /** |
|
251 * Get number of test modules. |
|
252 */ |
|
253 IMPORT_C TInt Count(void); |
|
254 |
|
255 /** |
|
256 * Get module. |
|
257 */ |
|
258 IMPORT_C CTestModuleInfo* GetModule(TDesC& aModuleName); |
|
259 |
|
260 /** |
|
261 * Get module. |
|
262 */ |
|
263 IMPORT_C CTestModuleInfo* GetModule(TInt aIndex); |
|
264 |
|
265 /** |
|
266 * Get first unchecked test case file (module: testscripter and testcombiner). |
|
267 */ |
|
268 IMPORT_C CTestCaseFileInfo* GetUncheckedCfgFile(void); |
|
269 |
|
270 protected: // New functions |
|
271 |
|
272 private: // New functions |
|
273 |
|
274 public: // Data |
|
275 |
|
276 protected: // Data |
|
277 |
|
278 private: // Data |
|
279 //Array of test modules |
|
280 RPointerArray<CTestModuleInfo> iTestModules; |
|
281 |
|
282 // Logger instance |
|
283 CStifLogger* iLogger; |
|
284 |
|
285 public: // Friend classes |
|
286 |
|
287 protected: // Friend classes |
|
288 |
|
289 private: // Friend classes |
|
290 }; |
|
291 |
|
292 #endif // TESTMODULEINFO_H |
|
293 |
|
294 // End of File |