stif/TestCombiner/inc/TestCombiner.h
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     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         // Pause combiner timer
       
   660         RTimer                      iPauseCombTimer;
       
   661         TInt                        iPauseCombRemainingTime;
       
   662 
       
   663         // Temporary line buffer 
       
   664         HBufC*                      iLine;
       
   665 
       
   666         // Remote control protocol timer
       
   667         CRemoteTimer*               iRemoteTimer;
       
   668 
       
   669         // Loop times, counter and start position
       
   670         TInt                    iLoopTimes;
       
   671         TInt                    iLoopCounter;
       
   672         TInt                    iLoopStartPos;
       
   673         TBuf<10>                iLoopCounterDes;
       
   674         TInt                    iEndLoopStartPos;
       
   675 
       
   676         // Loop passlimit (endurance) feature
       
   677         TInt                    iPasslimit;
       
   678         TBool                   iPasslimitEnabled;
       
   679         TInt                    iPassedIterationCnt;
       
   680         
       
   681         // Loop (timed loop option)
       
   682         TBool                   iTimedLoop;
       
   683         TTime                   iStartTime;
       
   684         TTimeIntervalMicroSeconds iExpectedLoopTime;
       
   685 
       
   686 		// Message displayed when leave occurs during script parsing
       
   687 		TBuf<256> iRunErrorMessage;
       
   688     public:      // Friend classes
       
   689 
       
   690     protected:  // Friend classes
       
   691 
       
   692     private:     // Friend classes
       
   693         friend class CTestCombiner;
       
   694 
       
   695     };
       
   696 
       
   697 // CLASS DECLARATION
       
   698 typedef TBuf<0x200> TRemoteProtMsg;
       
   699 
       
   700 // DESCRIPTION
       
   701 // CTestRemoteReceiver handles remote protocol receiving
       
   702 NONSHARABLE_CLASS(CRemoteReceiver) 
       
   703     :public CActive
       
   704     {
       
   705     public: // Enumerations
       
   706          
       
   707     private: // Enumerations
       
   708         enum TReceiverState
       
   709             {
       
   710             EReceiverIdle,
       
   711             EReceiverPending,
       
   712             };
       
   713 
       
   714     public:  // Constructors and destructor  
       
   715         /**
       
   716         * Two-phased constructor.
       
   717         */
       
   718         static CRemoteReceiver* NewL( CTestCombiner* aTestCombiner );
       
   719 
       
   720         /**
       
   721         * Destructor.
       
   722         */
       
   723         ~CRemoteReceiver();
       
   724 
       
   725     public: // New functions
       
   726         /**
       
   727         * Calls SetActive() from CActive.
       
   728         */
       
   729         void Start();
       
   730 
       
   731     public: // Functions from base classes     
       
   732         /**
       
   733         * RunL derived from CActive handles the completed requests.
       
   734         */
       
   735         void RunL();
       
   736 
       
   737         /**
       
   738         * DoCancel derived from CActive handles the Cancel.
       
   739         */
       
   740         void DoCancel();
       
   741 
       
   742     protected:  // New functions
       
   743 
       
   744     protected:  // Functions from base classes
       
   745 
       
   746     private:
       
   747         /**
       
   748         * C++ default constructor.
       
   749         */
       
   750         CRemoteReceiver( CTestCombiner* aTestCombiner );
       
   751 
       
   752         /**
       
   753         * By default Symbian OS constructor is private.
       
   754         */
       
   755         void ConstructL();
       
   756 
       
   757     public:     //Data
       
   758 
       
   759     protected:  // Data
       
   760 
       
   761     private:    // Data
       
   762         // Runner state
       
   763         TReceiverState              iState;
       
   764 
       
   765         // Backpointer to CTestCombiner
       
   766         CTestCombiner*              iTestCombiner;
       
   767 
       
   768         // Remote protocol message
       
   769         TRemoteProtMsg              iRemoteMsg;
       
   770 
       
   771     public:     // Friend classes
       
   772 
       
   773     protected:  // Friend classes
       
   774 
       
   775     private:    // Friend classes
       
   776 
       
   777     };
       
   778 
       
   779 // CLASS DECLARATION
       
   780 
       
   781 // DESCRIPTION
       
   782 // CRemoteTimer handles remote protocol timeouts
       
   783 NONSHARABLE_CLASS(CRemoteTimer) 
       
   784     :public CActive
       
   785     {
       
   786     public: // Enumerations
       
   787          
       
   788     private: // Enumerations
       
   789         enum TTimerState
       
   790             {
       
   791             ETimerIdle,
       
   792             ETimerPending,
       
   793             };
       
   794 
       
   795     public:  // Constructors and destructor  
       
   796         /**
       
   797         * Two-phased constructor.
       
   798         */
       
   799         static CRemoteTimer* NewL( CTestCombiner* aTestCombiner );
       
   800 
       
   801         /**
       
   802         * Destructor.
       
   803         */
       
   804         ~CRemoteTimer();
       
   805 
       
   806     public: // New functions
       
   807         /**
       
   808         * Starts timer.
       
   809         */
       
   810         void SetTimerActive( TTimeIntervalMicroSeconds32 anInterval );
       
   811 
       
   812     public: // Functions from base classes     
       
   813         /**
       
   814         * RunL derived from CActive handles the completed requests.
       
   815         */
       
   816         void RunL();
       
   817 
       
   818         /**
       
   819         * DoCancel derived from CActive handles the Cancel.
       
   820         */
       
   821         void DoCancel();
       
   822 
       
   823     protected:  // New functions
       
   824           
       
   825     protected:  // Functions from base classes
       
   826 
       
   827     private:
       
   828         /**
       
   829         * C++ default constructor.
       
   830         */
       
   831         CRemoteTimer( CTestCombiner* aTestCombiner );
       
   832 
       
   833         /**
       
   834         * By default Symbian OS constructor is private.
       
   835         */
       
   836         void ConstructL();
       
   837 
       
   838     public:     //Data
       
   839      
       
   840     protected:  // Data
       
   841 
       
   842     private:    // Data
       
   843         // Runner state
       
   844         TTimerState     iState;
       
   845 
       
   846         // Backpointer to CTestCombiner
       
   847         CTestCombiner*  iTestCombiner;
       
   848 
       
   849         // Pause timer
       
   850         RTimer          iTimer;
       
   851 
       
   852     public:      // Friend classes
       
   853 
       
   854     protected:  // Friend classes
       
   855 
       
   856     private:     // Friend classes
       
   857 
       
   858     };
       
   859 
       
   860 
       
   861 // DESCRIPTION
       
   862 // TTestMeasurement contains test measurement module information
       
   863 class TTestMeasurement
       
   864     {
       
   865     public: 
       
   866         TTestMeasurement(){ iMeasurement = NULL; };
       
   867         ~TTestMeasurement(){ delete iMeasurement; };
       
   868 
       
   869     public:
       
   870 
       
   871     public:
       
   872         // "object" name given in test case file.
       
   873         TName                   iName;
       
   874         // MSTIFTestInterference object.
       
   875         CSTIFTestMeasurement*  iMeasurement;
       
   876 
       
   877     private:
       
   878 
       
   879     };
       
   880 
       
   881 #endif        // TESTCOMBINER_H
       
   882 
       
   883 // End of File