testexecfw/symbianunittestfw/sutfw/inc/symbianunittestrunner.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 SYMBIANUNITTESTRUNNER_H
       
    19 #define SYMBIANUNITTESTRUNNER_H
       
    20 
       
    21 // INCLUDES
       
    22 #include "symbianunittestobserver.h"
       
    23 #include <badesca.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MSymbianUnitTestInterface;
       
    28 class CSymbianUnitTestResult;
       
    29 class MSymbianUnitTestUiCallBack;
       
    30 
       
    31 const TInt KSymbianUnitTestDefaultTimeout = 30;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 class CSymbianUnitTestRunner : public CBase, public MSymbianUnitTestObserver
       
    35     {
       
    36     public: // Constructors and destructor
       
    37     
       
    38         IMPORT_C static CSymbianUnitTestRunner* NewLC(
       
    39             MSymbianUnitTestUiCallBack& aUiCallBack );
       
    40     
       
    41         IMPORT_C static CSymbianUnitTestRunner* NewL(
       
    42             MSymbianUnitTestUiCallBack& aUiCallBack );
       
    43     
       
    44         IMPORT_C ~CSymbianUnitTestRunner();
       
    45     
       
    46     public: // From MSymbianUnitTestObserver
       
    47         
       
    48         void IncrementExecutedTestsCount();    
       
    49         
       
    50     public: // New functions
       
    51         
       
    52         IMPORT_C TInt TestCount();
       
    53         
       
    54         IMPORT_C void ExecuteTestsL( 
       
    55             const MDesCArray& aTestDllNames,
       
    56             TBool aMemoryAllocationFailureSimulation,
       
    57             const TDesC& aOutputFileName,
       
    58             const TDesC& aOutputFormat,
       
    59 	    const CDesCArray& aTestCaseNames, 
       
    60 	    TInt aTimeout = KSymbianUnitTestDefaultTimeout );
       
    61         
       
    62         IMPORT_C TInt FailedTestCount();
       
    63     
       
    64     private: // Constructors
       
    65     
       
    66         CSymbianUnitTestRunner( MSymbianUnitTestUiCallBack& aUiCallBack );
       
    67         void ConstructL();
       
    68     
       
    69     private: // New functions
       
    70         
       
    71         static void DeleteTest( TAny* aTest );
       
    72         
       
    73     private: // Data
       
    74         
       
    75         MSymbianUnitTestUiCallBack& iUiCallBack;
       
    76         CSymbianUnitTestResult* iResult;
       
    77         TInt iTestCount;
       
    78     };
       
    79 
       
    80 #endif // SYMBIANUNITTESTRUNNER_H