kerneltest/e32test/usbho/t_usbdi/inc/testengine.h
changeset 0 a41df078684a
equal deleted inserted replaced
-1:000000000000 0:a41df078684a
       
     1 #ifndef __TEST_ENGINE_H
       
     2 #define __TEST_ENGINE_H
       
     3 
       
     4 /*
       
     5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     6 * All rights reserved.
       
     7 * This component and the accompanying materials are made available
       
     8 * under the terms of the License "Eclipse Public License v1.0"
       
     9 * which accompanies this distribution, and is available
       
    10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    11 *
       
    12 * Initial Contributors:
       
    13 * Nokia Corporation - initial contribution.
       
    14 *
       
    15 * Contributors:
       
    16 *
       
    17 * Description:
       
    18 * @file TestEngine.h
       
    19 * @internalComponent
       
    20 * 
       
    21 *
       
    22 */
       
    23 
       
    24 
       
    25 
       
    26 #include <e32base.h>
       
    27 
       
    28 namespace NUnitTesting_USBDI
       
    29 	{ 
       
    30 	
       
    31 // Forward declarations
       
    32 
       
    33 class CTestCaseController;
       
    34 	
       
    35 /**
       
    36 This class represents the engine for this test module.
       
    37 It parses the command line and builds the test that should be run(through iTestCaseController)
       
    38 */
       
    39 class CTestEngine : public CActive
       
    40 	{
       
    41 public:
       
    42 	/**
       
    43 	Symbian Construction
       
    44 	@return a pointer to a new instance of CTestEngine
       
    45 	*/
       
    46 	
       
    47 	static CTestEngine* NewL();
       
    48 
       
    49 	/**
       
    50 	Destructor
       
    51 	*/
       
    52 	
       
    53 	~CTestEngine();
       
    54 	
       
    55 	/**
       
    56 	Retrieve the next in the list of test cases identities to run
       
    57 	@param an empty descriptor to populate with the next test case identity
       
    58 	@return KErrNone if successful or KErrNotFound if test cases identities depleted
       
    59 	*/
       
    60 	
       
    61 	TInt NextTestCaseId(TDes& aTestCaseId);
       
    62 
       
    63 	/**
       
    64 	Retrieve the list of test cases identities
       
    65 	@return the list of test cases identities
       
    66 	*/
       
    67 	
       
    68 	RPointerArray<HBufC>& TestCasesIdentities();
       
    69 	
       
    70 	/**
       
    71 	Retrieve the number of times the test cases are repeated
       
    72 	@the number of times the test cases are repeated
       
    73 	*/
       
    74 	
       
    75 	TUint NumRepeats();
       
    76 	
       
    77 private: // From CActive
       
    78 	/**
       
    79 	*/
       
    80 	
       
    81 	void DoCancel();
       
    82 	
       
    83 	/**
       
    84 	*/
       
    85 	
       
    86 	void RunL();
       
    87 	
       
    88 	/**
       
    89 	*/
       
    90 	
       
    91 	TInt RunError(TInt aError);	
       
    92 	
       
    93 private:
       
    94 	/**
       
    95 	C++ constructor
       
    96 	*/
       
    97 	
       
    98 	CTestEngine();
       
    99 	
       
   100 	/**
       
   101 	2nd phase constructor
       
   102 	*/
       
   103 	
       
   104 	void ConstructL();
       
   105 
       
   106 private:
       
   107 	/**
       
   108 	The test cases from the Xml file that the user wishes to execute
       
   109 	*/
       
   110 	RPointerArray<HBufC> iTestCasesIdentities;
       
   111 	
       
   112 	/**
       
   113 	*/
       
   114 	TInt iTestCaseIndex;
       
   115 		
       
   116 	/**
       
   117 	*/
       
   118 	TUint iRepeat;
       
   119 				
       
   120 	/**
       
   121 	*/
       
   122 	TUint iNumRepeats;
       
   123 
       
   124 	/**
       
   125 	The test controller
       
   126 	*/
       
   127 	CTestCaseController* iTestCaseController;
       
   128 	};
       
   129 
       
   130 	}
       
   131 	
       
   132 #endif