stif/ATSInterface/inc/ATSInterface.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 CATSInterface.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef ATS_INTERFACE_H
       
    19 #define ATS_INTERFACE_H
       
    20 
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include "TestEngineClient.h"
       
    26 #include "TestModuleInfo.h"
       
    27 
       
    28 // CONSTANTS
       
    29 // None
       
    30 
       
    31 // MACROS
       
    32 // None
       
    33 
       
    34 // DATA TYPES
       
    35 // None
       
    36 
       
    37 // FUNCTION PROTOTYPES
       
    38 // None
       
    39 
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CATSInterfaceRunner;
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 
       
    47 // DESCRIPTION
       
    48 // CATSInterface is the main class of ATS Interface
       
    49 
       
    50 class CATSInterface
       
    51         : public CBase
       
    52     {
       
    53     public: // Enumerations
       
    54         // None
       
    55 
       
    56     private: // Enumerations
       
    57         // None    
       
    58 
       
    59     public: // Constructors and destructor
       
    60         
       
    61         /**
       
    62         * Two-phased constructor.
       
    63         */
       
    64         static CATSInterface* NewL();
       
    65         
       
    66         /**
       
    67         * Destructor.
       
    68         */
       
    69         ~CATSInterface();
       
    70 
       
    71     public: // New functions
       
    72         
       
    73         /**
       
    74         * Run test cases
       
    75         */
       
    76         void RunTestsL();
       
    77 
       
    78         /**
       
    79         * Test case is completed
       
    80         */
       
    81         void TestCompleted( TInt aError );
       
    82 
       
    83         /**
       
    84         * Return handle to Test Engine Server.
       
    85         */
       
    86         RTestEngineServer& TestEngineServer();
       
    87 
       
    88         /**
       
    89         * Return handle to Test Engine.
       
    90         */
       
    91         RTestEngine& TestEngine();
       
    92 
       
    93     public: // Functions from base classes
       
    94         // None
       
    95 
       
    96     protected: // New functions
       
    97         // None
       
    98 
       
    99     protected: // Functions from base classes
       
   100         // None
       
   101 
       
   102     private: // New functions
       
   103 
       
   104         /**
       
   105         * By default Symbian OS constructor is private.
       
   106         */
       
   107         void ConstructL();
       
   108 
       
   109         /**
       
   110         * C++ default constructor.
       
   111         */
       
   112         CATSInterface();
       
   113 
       
   114         /**
       
   115         * Parse command line
       
   116         */
       
   117         void ParseCommandLineL();
       
   118 
       
   119         /**
       
   120         * Run all test cases
       
   121         */
       
   122         void RunAllTestCasesL();
       
   123 
       
   124         /**
       
   125         * Run the test case specified by aTestInfo.
       
   126         */
       
   127         void RunTestCaseL( TTestInfo& aTestInfo );
       
   128 
       
   129         /**
       
   130         * Run a test case
       
   131         */
       
   132         TInt RunATestCaseL( CATSInterfaceRunner* aTestCase );
       
   133 
       
   134         /**
       
   135         * Log errors and leave.
       
   136         */
       
   137         void LogErrorAndLeaveL( const TDesC& aFunction, 
       
   138                                 const TDesC& aDescription,
       
   139                                 const TInt aError );
       
   140 
       
   141         /**
       
   142         * Parse and search for module info and fill list of modules.
       
   143         */
       
   144         void ParseTestModulesL(CStifParser* aParser, CTestModuleList* aModuleList, const TDesC& aSectionStart, const TDesC& aSectionEnd);
       
   145 
       
   146     protected: // Data
       
   147         // None
       
   148 
       
   149     private: // Data
       
   150 
       
   151         // Console window
       
   152         CConsoleBase*           iConsole;
       
   153 
       
   154         // Handle to Test Engine Server
       
   155         RTestEngineServer       iTestEngineServ;
       
   156 
       
   157         // Handle to Test Engine
       
   158         RTestEngine             iTestEngine;
       
   159 
       
   160         // Complete error for test case
       
   161         TInt                    iTestCompletedError;
       
   162 
       
   163         // Test Module
       
   164         TName                   iTestModule;
       
   165 
       
   166         // Name of the Test Module's config file
       
   167         TFileName               iConfigFile;
       
   168 
       
   169         // Name of the Test Engine's ini file
       
   170         TFileName               iEngineIniFile;
       
   171 
       
   172         // Name of the Test Module's ini file
       
   173         TFileName               iModuleIniFile;
       
   174 
       
   175         // List of found modules (included from module given in parameters)
       
   176         CTestModuleList*        iModuleList;
       
   177 
       
   178     public: // Friend classes
       
   179         // None
       
   180 
       
   181     protected: // Friend classes
       
   182         // None
       
   183 
       
   184     private: // Friend classes
       
   185         // None
       
   186 
       
   187     };
       
   188 
       
   189 
       
   190 #endif // ATS_INTERFACE_H
       
   191 
       
   192 // End of File