kerneltest/e32test/usbho/t_otgdi/inc/testengine.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // @internalComponent
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef TESTENGINE_H
       
    19 #define TESTENGINE_H
       
    20 
       
    21 
       
    22 extern RTest test;
       
    23 
       
    24 extern TPtrC KMyApplicationName;
       
    25 
       
    26 extern TBool gSemiAutomated;
       
    27 extern TBool gVerboseOutput;
       
    28 extern TInt  gOOMIterations;
       
    29 extern TInt  gOpenIterations;
       
    30 extern TBool gTestRoleMaster; 
       
    31 extern TUint gUSBVidPid;
       
    32 
       
    33 	
       
    34 // Forward declarations
       
    35 class CTestCaseController;
       
    36 
       
    37 //	
       
    38 // This class represents the engine for this test module.  It is controlled by user (manual) 
       
    39 // key commands.
       
    40 //
       
    41 
       
    42 class CTestEngine : public CBase  //: public CActive
       
    43 	{
       
    44 public:
       
    45 	/**
       
    46 	Symbian Construction
       
    47 	@return a pointer to a new instance of CTestEngine
       
    48 	*/
       
    49 	static CTestEngine* NewL();
       
    50 
       
    51 
       
    52 	~CTestEngine();
       
    53 	
       
    54 	/**
       
    55 	Retrieve the next in the list of test cases identities to run
       
    56 	@param an empty descriptor to populate with the next test case identity
       
    57 	@return KErrNone if successful or KErrNotFound if test cases identities depleted
       
    58 	*/
       
    59 	TInt NextTestCaseId(TDes& aTestCaseId);
       
    60 
       
    61 	void Report();
       
    62 	// keyboard input
       
    63 	static void GetNumericInput(TInt &aNumber);
       
    64 
       
    65 private: 
       
    66 	// From CActive
       
    67 	void DoCancel();
       
    68 	
       
    69 	void RunL();
       
    70 	
       
    71 	TInt RunError(TInt aError);	
       
    72 	
       
    73 	CTestEngine();
       
    74 	
       
    75 	/**
       
    76 	2nd phase constructor
       
    77 	*/
       
    78 	void ConstructL();
       
    79 
       
    80 	// command-line handling methods
       
    81 	void ResetTestCaseIndex() {iTestCaseIndex=0;}
       
    82 	void AddAllDefaultTests();	
       
    83 	void ProcessCommandLineL();
       
    84 	void PrintUsage();
       
    85 
       
    86 	/**
       
    87 	The test cases that the user wishes to execute
       
    88 	*/
       
    89 	RPointerArray<HBufC> iTestCasesIdentities;
       
    90 	TInt 	iTestCaseIndex;
       
    91 	TBool 	iHelpRequested;
       
    92 	
       
    93 	/**
       
    94 	The test controller
       
    95 	*/
       
    96 	CTestCaseController* iTestCaseController;
       
    97 	};
       
    98 
       
    99 	
       
   100 #endif  // TESTENGINE_H