testexecfw/stf/stfui/atsui/inc/ATSInterface.h
changeset 2 8bb370ba6d1d
equal deleted inserted replaced
1:bbd31066657e 2:8bb370ba6d1d
       
     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         RTestEngine& TestEngine();
       
    87 
       
    88     public: // Functions from base classes
       
    89         // None
       
    90 
       
    91     protected: // New functions
       
    92         // None
       
    93 
       
    94     protected: // Functions from base classes
       
    95         // None
       
    96 
       
    97     private: // New functions
       
    98 
       
    99         /**
       
   100         * By default Symbian OS constructor is private.
       
   101         */
       
   102         void ConstructL();
       
   103 
       
   104         /**
       
   105         * C++ default constructor.
       
   106         */
       
   107         CATSInterface();
       
   108 
       
   109         /**
       
   110         * Parse command line
       
   111         */
       
   112         void ParseCommandLineL();
       
   113 
       
   114         /**
       
   115         * Run all test cases
       
   116         */
       
   117         void RunAllTestCasesL();
       
   118 
       
   119         /**
       
   120         * Run the test case specified by aTestInfo.
       
   121         */
       
   122         void RunTestCaseL( TTestInfo& aTestInfo );
       
   123 
       
   124         /**
       
   125         * Run a test case
       
   126         */
       
   127         TInt RunATestCaseL( CATSInterfaceRunner* aTestCase );
       
   128 
       
   129         /**
       
   130         * Log errors and leave.
       
   131         */
       
   132         void LogErrorAndLeaveL( const TDesC& aFunction, 
       
   133                                 const TDesC& aDescription,
       
   134                                 const TInt aError );
       
   135 
       
   136         /**
       
   137         * Parse and search for module info and fill list of modules.
       
   138         */
       
   139         void ParseTestModulesL(CStifParser* aParser, CTestModuleList* aModuleList, const TDesC& aSectionStart, const TDesC& aSectionEnd);
       
   140 
       
   141     protected: // Data
       
   142         // None
       
   143 
       
   144     private: // Data
       
   145 
       
   146         // Console window
       
   147         CConsoleBase*           iConsole;
       
   148 
       
   149         // Handle to Test Engine
       
   150         RTestEngine             iTestEngine;
       
   151 
       
   152         // Complete error for test case
       
   153         TInt                    iTestCompletedError;
       
   154 
       
   155         // Test Module
       
   156         TName                   iTestModule;
       
   157 
       
   158         // Name of the Test Module's config file
       
   159         TFileName               iConfigFile;
       
   160 
       
   161         // Name of the Test Engine's ini file
       
   162         TFileName               iEngineIniFile;
       
   163 
       
   164         // Name of the Test Module's ini file
       
   165         TFileName               iModuleIniFile;
       
   166 
       
   167         // List of found modules (included from module given in parameters)
       
   168         CTestModuleList*        iModuleList;
       
   169 
       
   170     public: // Friend classes
       
   171         // None
       
   172 
       
   173     protected: // Friend classes
       
   174         // None
       
   175 
       
   176     private: // Friend classes
       
   177         // None
       
   178 
       
   179     };
       
   180 
       
   181 
       
   182 #endif // ATS_INTERFACE_H
       
   183     
       
   184 // End of File