|
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 * TestCombiner module of STIF Test Framework. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef TESTCOMBINER_H |
|
20 #define TESTCOMBINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 #include <StifParser.h> |
|
26 #include <StifLogger.h> |
|
27 #include <StifTestEventInterface.h> |
|
28 #include <StifTestModule.h> |
|
29 #include <stifinternal/TestServerClient.h> |
|
30 #include "TestKeywords.h" |
|
31 #include "TestCombinerEvent.h" |
|
32 #include "TestCombinerUtils.h" |
|
33 #include "STIFMeasurement.h" |
|
34 |
|
35 // CONSTANTS |
|
36 // Printing priorities |
|
37 const TInt KPrintPriExec = 400; |
|
38 const TInt KPrintPriLow = 300; |
|
39 const TInt KPrintPriNorm = 200; |
|
40 const TInt KPrintPriHigh = 100; |
|
41 // Log dir and file |
|
42 _LIT( KTestCombinerLogDir, "\\Logs\\TestFramework\\TestCombiner\\" ); |
|
43 _LIT( KTestCombinerLogFile, "TestCombiner.txt" ); |
|
44 _LIT( KTestCombinerLogFileWithTitle, "TestCombiner_[%S].txt" ); |
|
45 // Configuration file tags |
|
46 _LIT( KTestStartTag, "[Test]" ); |
|
47 _LIT( KTestEndTag, "[Endtest]" ); |
|
48 // Define tags |
|
49 _LIT( KDefineStartTag, "[Define]" ); |
|
50 _LIT( KDefineEndTag, "[Enddefine]" ); |
|
51 // Initialization tags |
|
52 _LIT( KInitStartTag, "[Init]" ); |
|
53 _LIT( KInitEndTag, "[Endinit]" ); |
|
54 _LIT( KInitRcpTimeout, "rcptimeout" ); |
|
55 |
|
56 // Remote protocol timeout |
|
57 const TInt KRemoteProtocolTimeout = 30000000; |
|
58 // Remote protocol Master id |
|
59 const TUint32 KRemoteProtocolMasterId = 0xdeadbeef; |
|
60 |
|
61 // Loop counter macro |
|
62 _LIT( KLoopCounter, "LOOP_COUNTER" ); |
|
63 |
|
64 // MACROS |
|
65 // None |
|
66 |
|
67 // DATA TYPES |
|
68 // None |
|
69 |
|
70 // FUNCTION PROTOTYPES |
|
71 // None |
|
72 |
|
73 // FORWARD DECLARATIONS |
|
74 class CTestRunner; |
|
75 class CTestCase; |
|
76 class CTCTestCase; |
|
77 class CRemoteTestCase; |
|
78 class CTCTestModule; |
|
79 class CRemoteTimer; |
|
80 class CRemoteReceiver; |
|
81 class CRemoteSendReceive; |
|
82 class TTestMeasurement; |
|
83 |
|
84 // CLASS DECLARATION |
|
85 |
|
86 // DESCRIPTION |
|
87 // CTestCombiner contains the Test Module interface of TestCombiner |
|
88 // for STIF Test Framework |
|
89 |
|
90 NONSHARABLE_CLASS(CTestCombiner) |
|
91 :public CTestModuleBase |
|
92 { |
|
93 public: // Enumerations |
|
94 |
|
95 private: // Enumerations |
|
96 |
|
97 public: // Constructors and destructor |
|
98 /** |
|
99 * Two-phased constructor. |
|
100 */ |
|
101 static CTestCombiner* NewL(); |
|
102 |
|
103 /** |
|
104 * Destructor. |
|
105 */ |
|
106 ~CTestCombiner(); |
|
107 |
|
108 public: // New functions |
|
109 /** |
|
110 * Test Case completion from CTCTestCase. |
|
111 */ |
|
112 void Complete( CTestCase* aTestCase, TInt aError=KErrNone ); |
|
113 |
|
114 /** |
|
115 * Set event request pending. |
|
116 */ |
|
117 void SetEventPendingL( TEventIf aEvent ); |
|
118 |
|
119 /** |
|
120 * Handles timeouts. |
|
121 */ |
|
122 void RemoteTimeout(); |
|
123 |
|
124 /** |
|
125 * Handles responce received from slave |
|
126 */ |
|
127 void ReceiveResponse( TDesC& aMsg ); |
|
128 |
|
129 public: // Functions from base classes |
|
130 /** |
|
131 * Test module initialization. |
|
132 */ |
|
133 TInt InitL( TFileName& aIniFile, TBool aFirstTime ); |
|
134 |
|
135 /** |
|
136 * GetTestCasesL is used to inquire testcases. |
|
137 */ |
|
138 TInt GetTestCasesL( const TFileName& aConfigFile, |
|
139 RPointerArray<TTestCaseInfo>& aTestCases ); |
|
140 /** |
|
141 * RunTestCase is used to run an individual test case specified |
|
142 * by aTestCase. |
|
143 */ |
|
144 TInt RunTestCaseL( const TInt aCaseNumber, |
|
145 const TFileName& aConfig, |
|
146 TTestResult& aResult ); |
|
147 |
|
148 protected: // New functions |
|
149 |
|
150 protected: // Functions from base classes |
|
151 |
|
152 private: |
|
153 /** |
|
154 * C++ default constructor. |
|
155 */ |
|
156 CTestCombiner(); |
|
157 |
|
158 /** |
|
159 * By default Symbian OS constructor is private. |
|
160 */ |
|
161 void ConstructL(); |
|
162 |
|
163 /** |
|
164 * GetTestCaseL gets the specified test case section |
|
165 * from the configfile. |
|
166 */ |
|
167 CStifSectionParser* GetTestCaseL( TInt aCaseNumber, |
|
168 const TFileName& aConfig ); |
|
169 |
|
170 /** |
|
171 * RunTestL runs the testcase specified in section. |
|
172 */ |
|
173 void RunTestL(); |
|
174 |
|
175 /** |
|
176 * StartTestL starts a specified testcase from another test module. |
|
177 */ |
|
178 TInt StartTestL( CStartInfo& aStartInfo ); |
|
179 |
|
180 /** |
|
181 * GetTestModuleL returns a specified test module description. |
|
182 */ |
|
183 CTCTestModule* GetTestModuleL( TDesC& aModule, |
|
184 TDesC& aIniFile, |
|
185 const TDesC& aConfigFile ); |
|
186 |
|
187 /** |
|
188 * Gets a testcase identified with testid from test case array. |
|
189 */ |
|
190 CTestCase* GetTest( TDesC& aTestId ); |
|
191 |
|
192 /** |
|
193 * Gets a running testcase identified with testid from test case array. |
|
194 */ |
|
195 CTestCase* GetRunningTest( TDesC& aTestId ); |
|
196 |
|
197 /** |
|
198 * Gets a testcase identified with testid from test case array. |
|
199 */ |
|
200 CTCTestCase* GetLocalTest( TDesC& aTestId ); |
|
201 |
|
202 /** |
|
203 * Gets a running testcase identified with testid from test case array. |
|
204 */ |
|
205 CTCTestCase* GetLocalRunningTest( TDesC& aTestId ); |
|
206 |
|
207 /** |
|
208 * Gets a testcase identified with aSlaveId from slave array. |
|
209 */ |
|
210 CRemoteTestCase* GetRemoteTest( TDesC& aTestId ); |
|
211 |
|
212 /** |
|
213 * Gets a testcase identified with aSlaveId from slave array. |
|
214 */ |
|
215 CRemoteTestCase* GetRemoteTest( TUint32 aSlaveId ); |
|
216 |
|
217 CRemoteTestCase* GetRemoteTestRunSent( TUint32 aSlaveId ); |
|
218 /** |
|
219 * Gets a running testcase identified with aSlaveId from slave array. |
|
220 */ |
|
221 CRemoteTestCase* GetRunningRemoteTest( TUint32 aSlaveId ); |
|
222 |
|
223 /** |
|
224 * Gets a testcase running on slave with aSlaveDevId. |
|
225 */ |
|
226 CRemoteTestCase* GetRemoteRunningTestOnSlave( TUint32 aSlaveDevId ); |
|
227 |
|
228 /** |
|
229 * Gets a correct CRemoteSendReceive object on slave with aSlaveId. |
|
230 */ |
|
231 CRemoteSendReceive* GetRemoteSendReceive( TUint32 aSlaveId ); |
|
232 |
|
233 /** |
|
234 * Get running slave. |
|
235 */ |
|
236 CSlaveInfo* CTestCombiner::GetSlave( TUint32 aSlaveId ); |
|
237 CSlaveInfo* CTestCombiner::GetSlave( TDesC& aSlaveName ); |
|
238 |
|
239 /** |
|
240 * Check requested events and send unset to first requested. |
|
241 */ |
|
242 TBool UnsetEvent( TEventIf& aEvent, TRequestStatus& aStatus ); |
|
243 |
|
244 /** |
|
245 * Read initialization from file. |
|
246 */ |
|
247 void ReadInitializationL( const TDesC& aIniFile ); |
|
248 |
|
249 /** |
|
250 * Executes measurement script line. |
|
251 */ |
|
252 void ExecuteMeasurementL( CStifItemParser* aItem ); |
|
253 |
|
254 /** |
|
255 * Starts measurement. |
|
256 */ |
|
257 void StartMeasurementL( const TDesC& aType, CStifItemParser* aItem ); |
|
258 |
|
259 /** |
|
260 * Stops measurementplugin's measurement. |
|
261 */ |
|
262 void StopMeasurementL( const TDesC& aType ); |
|
263 |
|
264 /** |
|
265 * Returns new index for test module controller. |
|
266 * This number is appended to module controller name. |
|
267 * This method is used when option to run every test case in separate |
|
268 * process is set to on. |
|
269 */ |
|
270 TInt GetIndexForNewTestModuleController(void); |
|
271 |
|
272 /** |
|
273 * Append to TC's result description (if possible due to length) |
|
274 * limitation provided text in [] brackets. |
|
275 */ |
|
276 void AppendTestResultToResultDes(TDes& aResultDescr, const TDesC& aTestCaseResultDescr); |
|
277 |
|
278 |
|
279 public: // Data |
|
280 // Logger |
|
281 CStifLogger* iLog; |
|
282 |
|
283 protected: // Data |
|
284 |
|
285 private: // Data |
|
286 // Test case array of running/runned test cases |
|
287 RPointerArray<CTestCase> iTestCases; |
|
288 |
|
289 // SendReceive array(asynchronous sendreveive) |
|
290 RPointerArray<CRemoteSendReceive> iSendReceive; |
|
291 |
|
292 // Array of test modules |
|
293 RPointerArray<CTCTestModule> iTestModules; |
|
294 |
|
295 // TestId of the waited (by complete keyword) test case |
|
296 TName iWaitTestCase; |
|
297 |
|
298 // Flag to indicate that activescheduler is started |
|
299 TBool iSchedulerActive; |
|
300 |
|
301 // Number of currently running test cases |
|
302 TInt iRunningTests; |
|
303 |
|
304 // Test case result of the TestCombiner |
|
305 TInt iResult; |
|
306 |
|
307 // Error code in case when execution of script fails |
|
308 TInt iScriptFailed; |
|
309 |
|
310 // Error description in case when execution of script fails |
|
311 TName iScriptFailedDescription; |
|
312 |
|
313 // Sectionparser for the current testcase |
|
314 CStifSectionParser* iSectionParser; |
|
315 |
|
316 // Pointer to used testrunner |
|
317 CTestRunner* iTestRunner; |
|
318 |
|
319 // Pointer to used testrunner |
|
320 CRemoteReceiver* iRemoteReceiver; |
|
321 |
|
322 // Event for async NotifyEvent |
|
323 TEventIf iEvent; |
|
324 TEventIfPckg iEventPckg; |
|
325 |
|
326 RPointerArray<TEventTc> iEventArray; |
|
327 |
|
328 // Predefined values are listed here |
|
329 RPointerArray<CDefinedValue> iDefined; |
|
330 |
|
331 // CSlaveInfo |
|
332 RPointerArray<CSlaveInfo> iSlaveArray; |
|
333 |
|
334 // Remote protocol timeout |
|
335 TInt iRemoteTimeout; |
|
336 |
|
337 // Variable for abortimmediately keyword @js |
|
338 TBool iCancelIfError; |
|
339 |
|
340 // Number of the failed test case, needed when using |
|
341 // abortimmediately keyword @js |
|
342 TInt iFailedTestCase; |
|
343 |
|
344 // CStifTestMeasurement object |
|
345 RPointerArray<TTestMeasurement> iTestMeasurementArray; |
|
346 |
|
347 // Indicate that loop is used in test case file. |
|
348 // This is used for reseting and allowing allocated id's etc. |
|
349 // (E.g. testid values can be same in loop). |
|
350 TBool iLoopIsUsed; |
|
351 RArray<TAny*> iLoopAllocationArray; |
|
352 |
|
353 // Standard Logger |
|
354 CStifLogger* iStdLog; |
|
355 |
|
356 // Test case Logger |
|
357 CStifLogger* iTCLog; |
|
358 |
|
359 // Flag which says if test case title should be appended to the |
|
360 // log file name. This is read from SettingServer |
|
361 TBool iAddTestCaseTitleToLogName; |
|
362 |
|
363 // Counter for created TCModuleControllers |
|
364 TInt iIndexTestModuleControllers; |
|
365 |
|
366 // Is this UI testing? |
|
367 // If yes, then Test Engine works in a specific way. |
|
368 // It creates new process for every test scripter's test case |
|
369 // and deletes it after test case has finished. |
|
370 TBool iUITestingSupport; |
|
371 |
|
372 // Should every test case be executed in separate process? |
|
373 // This option is similar to iUITestingSupport, however |
|
374 // it does not delete the process after test case is finished. |
|
375 TBool iSeparateProcesses; |
|
376 |
|
377 public: // Friend classes |
|
378 |
|
379 protected: // Friend classes |
|
380 |
|
381 private: // Friend classes |
|
382 friend class CTestRunner; |
|
383 friend class CTestEventNotifier; |
|
384 |
|
385 }; |
|
386 |
|
387 // CLASS DECLARATION |
|
388 |
|
389 // DESCRIPTION |
|
390 // CTestRunner parses the TestCombiner configuration file and |
|
391 // runs a testcase. CTestRunner is the friend of CTestCombiner |
|
392 // and uses its private member variables directly. |
|
393 |
|
394 NONSHARABLE_CLASS(CTestRunner) |
|
395 :public CActive |
|
396 { |
|
397 public: // Enumerations |
|
398 |
|
399 private: // Enumerations |
|
400 enum TRunnerState{ |
|
401 ERunnerIdle, |
|
402 ERunnerRunning, |
|
403 ERunnerWaitTestCase, |
|
404 ERunnerWaitEvent, |
|
405 ERunnerWaitUnset, |
|
406 ERunnerWaitTimeout, |
|
407 ERunnerCancel, |
|
408 ERunnerError, |
|
409 ERunnerAllocate, |
|
410 ERunnerFree, |
|
411 ERunnerRemote, |
|
412 ERunnerReady, |
|
413 }; |
|
414 |
|
415 public: // Constructors and destructor |
|
416 /** |
|
417 * Two-phased constructor. |
|
418 */ |
|
419 static CTestRunner* NewL( CTestCombiner* aTestCombiner ); |
|
420 |
|
421 /** |
|
422 * Destructor. |
|
423 */ |
|
424 ~CTestRunner(); |
|
425 |
|
426 public: // New functions |
|
427 /** |
|
428 * Calls SetActive() from CActive. |
|
429 */ |
|
430 void SetRunnerActive(); |
|
431 |
|
432 /** |
|
433 * Handles received response from slave. |
|
434 */ |
|
435 TBool ReceiveResponseL( TDesC& aMsg ); |
|
436 |
|
437 /** |
|
438 * Cancel testcases. |
|
439 */ |
|
440 void CancelTestCases(); |
|
441 |
|
442 public: // Functions from base classes |
|
443 /** |
|
444 * RunL derived from CActive handles the completed requests. |
|
445 */ |
|
446 void RunL(); |
|
447 |
|
448 /** |
|
449 * DoCancel derived from CActive handles the Cancel. |
|
450 */ |
|
451 void DoCancel(); |
|
452 |
|
453 /** |
|
454 * RunError derived from CActive handles errors from active handler. |
|
455 */ |
|
456 TInt RunError( TInt aError ); |
|
457 |
|
458 protected: // New functions |
|
459 |
|
460 protected: // Functions from base classes |
|
461 |
|
462 private: |
|
463 /** |
|
464 * C++ default constructor. |
|
465 */ |
|
466 CTestRunner( CTestCombiner* aTestCombiner ); |
|
467 |
|
468 /** |
|
469 * By default Symbian OS constructor is private. |
|
470 */ |
|
471 void ConstructL(); |
|
472 |
|
473 /** |
|
474 * Executes one script line. |
|
475 */ |
|
476 TBool ExecuteLineL( CStifItemParser* aItem ); |
|
477 |
|
478 /** |
|
479 * Executes run script line. |
|
480 */ |
|
481 TBool ExecuteRunL( CStifItemParser* aItem ); |
|
482 |
|
483 /** |
|
484 * Parses run parameters. |
|
485 */ |
|
486 void ParseRunParamsL( CStifItemParser* aItem, CStartInfo& aStartInfo ); |
|
487 |
|
488 /** |
|
489 * Executes test control script line. |
|
490 */ |
|
491 TBool ExecuteTestCtlL( CStifItemParser* aItem, |
|
492 TTCKeywords::TKeywords aKeyword ); |
|
493 |
|
494 /** |
|
495 * Executes pause in combiner |
|
496 */ |
|
497 TBool ExecuteCombinerPauseL( CStifItemParser* aItem ); |
|
498 |
|
499 /** |
|
500 * Executes pause script line. |
|
501 */ |
|
502 TBool ExecutePauseL( CStifItemParser* aItem, CTestCase* aTestCase ); |
|
503 |
|
504 /** |
|
505 * Executes complete script line. |
|
506 */ |
|
507 TBool ExecuteCompleteL( CStifItemParser* aItem, CTestCase* aTestCase ); |
|
508 |
|
509 /** |
|
510 * Executes event set script line. |
|
511 */ |
|
512 TBool ExecuteEventSetL( CStifItemParser* aItem ); |
|
513 |
|
514 /** |
|
515 * Executes event unset script line. |
|
516 */ |
|
517 TBool ExecuteEventUnsetL( CStifItemParser* aItem ); |
|
518 |
|
519 /** |
|
520 * Executes event control command. |
|
521 */ |
|
522 TBool ExecuteEventCtlL( CStifItemParser* aItem, |
|
523 TTCKeywords::TKeywords aKeyword ); |
|
524 |
|
525 /** |
|
526 * Executes allocate script line. |
|
527 */ |
|
528 TBool ExecuteAllocateL( CStifItemParser* aItem ); |
|
529 |
|
530 /** |
|
531 * Executes free script line. |
|
532 */ |
|
533 TBool ExecuteFreeL( CStifItemParser* aItem ); |
|
534 |
|
535 /** |
|
536 * Frees slave. |
|
537 */ |
|
538 void ExecuteFreeL( CSlaveInfo* aSlave ); |
|
539 |
|
540 /** |
|
541 * Executes remote script line. |
|
542 */ |
|
543 TBool ExecuteRemoteL( CStifItemParser* aItem ); |
|
544 |
|
545 /** |
|
546 * Executes remote run script line. |
|
547 */ |
|
548 TBool ExecuteRemoteRunL( CStifItemParser* aItem, CSlaveInfo* aSlave, |
|
549 HBufC *aSetUnsetEvent = NULL, |
|
550 TInt aCaseNumber = 0 ); |
|
551 |
|
552 /** |
|
553 * Executes remote test control script line. |
|
554 */ |
|
555 TBool ExecuteRemoteTestCtlL( CStifItemParser* aItem, |
|
556 CTestCase* aTestCase, |
|
557 TInt aCmd ); |
|
558 |
|
559 /** |
|
560 * Executes remote event control script line. |
|
561 */ |
|
562 TBool ExecuteRemoteEventCtlL( CStifItemParser* aItem, |
|
563 CSlaveInfo* aSlave, |
|
564 TInt aCmd ); |
|
565 |
|
566 /** |
|
567 * Executes remote event set unset line |
|
568 */ |
|
569 TBool ExecuteRemoteSetUnsetEventL( CStifItemParser* aItem, |
|
570 CSlaveInfo* aSlave, |
|
571 TInt aCmd ); |
|
572 |
|
573 /** |
|
574 * Executes asynchronous remote sendreceive control script line. |
|
575 */ |
|
576 TBool ExecuteRemoteSendReceiveL( CStifItemParser* aItem, |
|
577 CSlaveInfo* aSlave ); |
|
578 |
|
579 /** |
|
580 * Executes remote unknown control script line. |
|
581 */ |
|
582 TBool ExecuteRemoteUnknownL( CStifItemParser* aItem, |
|
583 CSlaveInfo* aSlave, |
|
584 TDesC& aCommand ); |
|
585 /** |
|
586 * Handles received run responses from slave. |
|
587 */ |
|
588 TBool ReceiveResponseRunL( CStifTFwIfProt& aMsg ); |
|
589 |
|
590 /** |
|
591 * Handles received test control responses from slave. |
|
592 */ |
|
593 TBool ReceiveResponseTestCtlL( CStifTFwIfProt& aMsg ); |
|
594 |
|
595 /** |
|
596 * Handles received Event system control responses from slave. |
|
597 */ |
|
598 TBool ReceiveResponseEventCtlL( CStifTFwIfProt& aMsg ); |
|
599 |
|
600 /** |
|
601 * Handles received asynchronous sendreceive responses from slave. |
|
602 */ |
|
603 TBool ReceiveResponseSendReceiveL( CStifTFwIfProt& aMsg ); |
|
604 |
|
605 /** |
|
606 * Handles received responses for unspecified commands from slave. |
|
607 */ |
|
608 TBool ReceiveResponseUnknownL( CStifTFwIfProt& aMsg ); |
|
609 |
|
610 /** |
|
611 * Check unset event we are waiting. |
|
612 */ |
|
613 TBool CheckUnsetEvent(); |
|
614 |
|
615 /** |
|
616 * Parses optional argument. |
|
617 */ |
|
618 void ParseOptArgL( const TDesC& aOptArg, TPtrC& aArg, TPtrC& aVal); |
|
619 |
|
620 /** |
|
621 * Preprocess hardcoded values in test case. |
|
622 */ |
|
623 CStifItemParser* PreprocessLineL( TDesC& line ); |
|
624 |
|
625 /** |
|
626 * Checks if aWord is defined value. |
|
627 */ |
|
628 TInt CheckDefined( TPtrC& aWord ); |
|
629 |
|
630 /** |
|
631 * Handle the loop keyword operations. |
|
632 */ |
|
633 void ExecuteLoopL( CStifItemParser* aItem ); |
|
634 |
|
635 /** |
|
636 * Handle the endloop keyword operations. |
|
637 */ |
|
638 TBool ExecuteEndLoopL(); |
|
639 |
|
640 public: //Data |
|
641 |
|
642 protected: // Data |
|
643 |
|
644 private: // Data |
|
645 // Runner state |
|
646 TRunnerState iState; |
|
647 |
|
648 // Backpointer to CTestCombiner |
|
649 CTestCombiner* iTestCombiner; |
|
650 |
|
651 // Event system control |
|
652 TEventIf iEvent; |
|
653 |
|
654 // Pause timer |
|
655 RTimer iPauseTimer; |
|
656 TName iPausedTestCase; |
|
657 TInt iPauseTime; |
|
658 |
|
659 // Temporary line buffer |
|
660 HBufC* iLine; |
|
661 |
|
662 // Remote control protocol timer |
|
663 CRemoteTimer* iRemoteTimer; |
|
664 |
|
665 // Loop times, counter and start position |
|
666 TInt iLoopTimes; |
|
667 TInt iLoopCounter; |
|
668 TInt iLoopStartPos; |
|
669 TBuf<10> iLoopCounterDes; |
|
670 TInt iEndLoopStartPos; |
|
671 |
|
672 // Loop passlimit (endurance) feature |
|
673 TInt iPasslimit; |
|
674 TBool iPasslimitEnabled; |
|
675 TInt iPassedIterationCnt; |
|
676 |
|
677 // Loop (timed loop option) |
|
678 TBool iTimedLoop; |
|
679 TTime iStartTime; |
|
680 TTimeIntervalMicroSeconds iExpectedLoopTime; |
|
681 |
|
682 // Message displayed when leave occurs during script parsing |
|
683 TBuf<256> iRunErrorMessage; |
|
684 public: // Friend classes |
|
685 |
|
686 protected: // Friend classes |
|
687 |
|
688 private: // Friend classes |
|
689 friend class CTestCombiner; |
|
690 |
|
691 }; |
|
692 |
|
693 // CLASS DECLARATION |
|
694 typedef TBuf<0x200> TRemoteProtMsg; |
|
695 |
|
696 // DESCRIPTION |
|
697 // CTestRemoteReceiver handles remote protocol receiving |
|
698 NONSHARABLE_CLASS(CRemoteReceiver) |
|
699 :public CActive |
|
700 { |
|
701 public: // Enumerations |
|
702 |
|
703 private: // Enumerations |
|
704 enum TReceiverState |
|
705 { |
|
706 EReceiverIdle, |
|
707 EReceiverPending, |
|
708 }; |
|
709 |
|
710 public: // Constructors and destructor |
|
711 /** |
|
712 * Two-phased constructor. |
|
713 */ |
|
714 static CRemoteReceiver* NewL( CTestCombiner* aTestCombiner ); |
|
715 |
|
716 /** |
|
717 * Destructor. |
|
718 */ |
|
719 ~CRemoteReceiver(); |
|
720 |
|
721 public: // New functions |
|
722 /** |
|
723 * Calls SetActive() from CActive. |
|
724 */ |
|
725 void Start(); |
|
726 |
|
727 public: // Functions from base classes |
|
728 /** |
|
729 * RunL derived from CActive handles the completed requests. |
|
730 */ |
|
731 void RunL(); |
|
732 |
|
733 /** |
|
734 * DoCancel derived from CActive handles the Cancel. |
|
735 */ |
|
736 void DoCancel(); |
|
737 |
|
738 protected: // New functions |
|
739 |
|
740 protected: // Functions from base classes |
|
741 |
|
742 private: |
|
743 /** |
|
744 * C++ default constructor. |
|
745 */ |
|
746 CRemoteReceiver( CTestCombiner* aTestCombiner ); |
|
747 |
|
748 /** |
|
749 * By default Symbian OS constructor is private. |
|
750 */ |
|
751 void ConstructL(); |
|
752 |
|
753 public: //Data |
|
754 |
|
755 protected: // Data |
|
756 |
|
757 private: // Data |
|
758 // Runner state |
|
759 TReceiverState iState; |
|
760 |
|
761 // Backpointer to CTestCombiner |
|
762 CTestCombiner* iTestCombiner; |
|
763 |
|
764 // Remote protocol message |
|
765 TRemoteProtMsg iRemoteMsg; |
|
766 |
|
767 public: // Friend classes |
|
768 |
|
769 protected: // Friend classes |
|
770 |
|
771 private: // Friend classes |
|
772 |
|
773 }; |
|
774 |
|
775 // CLASS DECLARATION |
|
776 |
|
777 // DESCRIPTION |
|
778 // CRemoteTimer handles remote protocol timeouts |
|
779 NONSHARABLE_CLASS(CRemoteTimer) |
|
780 :public CActive |
|
781 { |
|
782 public: // Enumerations |
|
783 |
|
784 private: // Enumerations |
|
785 enum TTimerState |
|
786 { |
|
787 ETimerIdle, |
|
788 ETimerPending, |
|
789 }; |
|
790 |
|
791 public: // Constructors and destructor |
|
792 /** |
|
793 * Two-phased constructor. |
|
794 */ |
|
795 static CRemoteTimer* NewL( CTestCombiner* aTestCombiner ); |
|
796 |
|
797 /** |
|
798 * Destructor. |
|
799 */ |
|
800 ~CRemoteTimer(); |
|
801 |
|
802 public: // New functions |
|
803 /** |
|
804 * Starts timer. |
|
805 */ |
|
806 void SetTimerActive( TTimeIntervalMicroSeconds32 anInterval ); |
|
807 |
|
808 public: // Functions from base classes |
|
809 /** |
|
810 * RunL derived from CActive handles the completed requests. |
|
811 */ |
|
812 void RunL(); |
|
813 |
|
814 /** |
|
815 * DoCancel derived from CActive handles the Cancel. |
|
816 */ |
|
817 void DoCancel(); |
|
818 |
|
819 protected: // New functions |
|
820 |
|
821 protected: // Functions from base classes |
|
822 |
|
823 private: |
|
824 /** |
|
825 * C++ default constructor. |
|
826 */ |
|
827 CRemoteTimer( CTestCombiner* aTestCombiner ); |
|
828 |
|
829 /** |
|
830 * By default Symbian OS constructor is private. |
|
831 */ |
|
832 void ConstructL(); |
|
833 |
|
834 public: //Data |
|
835 |
|
836 protected: // Data |
|
837 |
|
838 private: // Data |
|
839 // Runner state |
|
840 TTimerState iState; |
|
841 |
|
842 // Backpointer to CTestCombiner |
|
843 CTestCombiner* iTestCombiner; |
|
844 |
|
845 // Pause timer |
|
846 RTimer iTimer; |
|
847 |
|
848 public: // Friend classes |
|
849 |
|
850 protected: // Friend classes |
|
851 |
|
852 private: // Friend classes |
|
853 |
|
854 }; |
|
855 |
|
856 |
|
857 // DESCRIPTION |
|
858 // TTestMeasurement contains test measurement module information |
|
859 class TTestMeasurement |
|
860 { |
|
861 public: |
|
862 TTestMeasurement(){ iMeasurement = NULL; }; |
|
863 ~TTestMeasurement(){ delete iMeasurement; }; |
|
864 |
|
865 public: |
|
866 |
|
867 public: |
|
868 // "object" name given in test case file. |
|
869 TName iName; |
|
870 // MSTIFTestInterference object. |
|
871 CSTIFTestMeasurement* iMeasurement; |
|
872 |
|
873 private: |
|
874 |
|
875 }; |
|
876 |
|
877 #endif // TESTCOMBINER_H |
|
878 |
|
879 // End of File |