testexecfw/symbianunittestfw/symbianunittestfw_pub/symbian_unit_test_api/inc/symbianunittestinterface.h
changeset 0 3e07fef1e154
equal deleted inserted replaced
-1:000000000000 0:3e07fef1e154
       
     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:  
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef SYMBIANUNITTESTINTERFACE_H
       
    19 #define SYMBIANUNITTESTINTERFACE_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <badesca.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class MSymbianUnitTestObserver;
       
    27 class CSymbianUnitTestResult;
       
    28 
       
    29 // CONSTANTS
       
    30 /**
       
    31 * All the DLLs containing Symbian unit tests should use the following UID
       
    32 */
       
    33 const TUid KSymbianUnitTestDllUid = { 0x20022E76 };
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37 * The interface that is implemented by all 
       
    38 * the unit tests and collections of unit tests.
       
    39 * Provides a common interface 
       
    40 * for Symbian unit test framework to execute the unit tests.
       
    41 *
       
    42 * @lib symbianunittestfw.lib
       
    43 */
       
    44 class MSymbianUnitTestInterface
       
    45     {
       
    46     public: // Enumerations
       
    47     
       
    48         /** Test failure simulation types */
       
    49         enum TFailureSimulation 
       
    50             {
       
    51             /** No failure simulation */
       
    52             ENoFailureSimulation,
       
    53             /** Memory allocation failure simulation */
       
    54             EMemAllocFailureSimulation
       
    55             };     
       
    56     
       
    57     public: // New functions
       
    58     
       
    59         /**
       
    60         * Virtual destructor to enable the framework to delete
       
    61         * the unit test or the unit test collection through this interface
       
    62         */       
       
    63         virtual ~MSymbianUnitTestInterface() { }       
       
    64 
       
    65         /**
       
    66         * Function called by the framework to execute 
       
    67         * the unit tests contained in this object.
       
    68         * 
       
    69         * @param aObserver an observer for the test progress 
       
    70         * @param aResult the test result
       
    71         * @param aFailureSimulation the type of failure simulation to be used
       
    72         * @param aTestCaseNames the test cases to run
       
    73 	* @param aTimeout the time out value for test execution
       
    74         */        
       
    75         virtual void ExecuteL( 
       
    76             MSymbianUnitTestObserver& aObserver,
       
    77             CSymbianUnitTestResult& aResult,
       
    78             TFailureSimulation aFailureSimulation,
       
    79 	    const CDesCArray& aTestCaseNames,
       
    80 	    TInt aTimeout) = 0;
       
    81 
       
    82         /**
       
    83         * Returns the number of unit tests contained in this object
       
    84         * @return The number of unit tests in this object
       
    85         */        
       
    86         virtual TInt TestCaseCount() = 0;
       
    87 
       
    88         /**
       
    89         * @return The name of this unit test or unit test collection
       
    90         */        
       
    91         virtual const TDesC& Name() const = 0;
       
    92     };
       
    93 
       
    94 #endif // SYMBIANUNITTESTINTERFACE_H