networkingtestandutils/networkingintegrationtest/inc/TestSuite.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 /**
       
     2 * Copyright (c) 2003-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 * This contains CTestSuite which is the Abstract base class
       
    16 * for all the TestSuite DLLs
       
    17 * 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 /**
       
    24  @file TestSuite.h
       
    25 */
       
    26 
       
    27 #if (!defined __TESTSUITE_H__)
       
    28 #define __TESTSUITE_H__
       
    29 
       
    30 
       
    31 #include "networking/log.h"
       
    32 
       
    33 /**
       
    34 Maximum length for test suite name
       
    35 @internalComponent
       
    36 */
       
    37 #define MAX_LEN_TEST_SUITE_NAME 55
       
    38 
       
    39 
       
    40 class CTestStep;
       
    41 
       
    42 class CTestSuite : public CBase
       
    43 /**
       
    44 Abstract base class for all test suites
       
    45 @internalAll
       
    46 */
       
    47 {
       
    48 public:
       
    49 	/** second phase constructor */
       
    50 	IMPORT_C void ConstructL( void );
       
    51 
       
    52 	/** destructor */
       
    53 	IMPORT_C virtual ~CTestSuite();
       
    54 
       
    55     IMPORT_C void OverrideSuiteName(const TDesC& aNewName);
       
    56 
       
    57 	/** add a test step to the suite */
       
    58 	IMPORT_C void AddTestStepL( CTestStep * ptrTestStep );
       
    59 
       
    60 	/** public interface to run test steps */
       
    61 	IMPORT_C enum TVerdict DoTestStep( TDesC &step, TDesC &config );
       
    62 
       
    63 	/** public interface to run unit test */
       
    64 	IMPORT_C virtual enum TVerdict DoTestUnit( TDesC &config );
       
    65 
       
    66 	/** 
       
    67 	Test suite second phase initialisation
       
    68 	pure-virtual, all test suites must implement this
       
    69 	this is called from CTestSuite::ConstructL 
       
    70 	*/
       
    71 	virtual void InitialiseL( void ) = 0;
       
    72 
       
    73 	IMPORT_C void Log( TRefByValue<const TDesC16> format, ... );
       
    74 	IMPORT_C void Log( TInt aSeverity, TRefByValue<const TDesC16> format, ... );
       
    75 
       
    76 	IMPORT_C void LogExtra(const TText8* aFile, TInt aLine, TInt aSeverity,
       
    77 		TRefByValue<const TDesC> aFmt,...);
       
    78 
       
    79 	/**
       
    80 	this should be a pure virtual so every test ddl
       
    81 	has to provide a version but for now defaults to ?.?
       
    82 	*/
       
    83 	IMPORT_C virtual TPtrC GetVersion( void );
       
    84 
       
    85 	/** set severity */
       
    86 	IMPORT_C void SetSeverity( TInt aSeverity);
       
    87 
       
    88 	/** get severity level */
       
    89 	IMPORT_C TInt Severity();
       
    90 
       
    91 	/** set */
       
    92 	IMPORT_C void SetLogSystem(CLog *aLogger);
       
    93 
       
    94 	/** log data buffer */
       
    95 	TBuf<32384>		iLogData;
       
    96 protected:
       
    97 	/** test functions */
       
    98 	IMPORT_C void testBooleanTrueL( TBool aCondition, char* aFile, TInt aLine );
       
    99 
       
   100 private:
       
   101 
       
   102     /** 
       
   103         the name of this suite, is used for reporting only.
       
   104         Is set automatically during loading test suite dll.
       
   105         Can be overriden, but there is no need.
       
   106     */
       
   107 	TBuf<MAX_LEN_TEST_SUITE_NAME> iSuiteName;
       
   108 
       
   109 	/** severity level */
       
   110 	TInt iSeverity;
       
   111 
       
   112 	/** File logging system */
       
   113 	CLog *iLogger;
       
   114 
       
   115 	/** array of pointers to the test steps in this suite */
       
   116 	CArrayPtrFlat<CTestStep> *	iArrayTestSteps;
       
   117 };
       
   118 
       
   119 #endif /* __TESTSUITE_H__ */