sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __T_FRAMEWORK_H__ sl@0: #define __T_FRAMEWORK_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #define TF_ERROR(aRes, aCond) ((void) ((aCond) || (CTestProgram::Panic(aRes, #aCond, __FILE__, __LINE__), 0))) sl@0: #define TF_ERROR_PROG(aProg, aRes, aCond) ((void) ((aCond) || ((aProg)->Panic(aRes, #aCond, __FILE__, __LINE__), 0))) sl@0: sl@0: class CTestProgram : public CBase sl@0: { sl@0: public: sl@0: sl@0: static void Start(); sl@0: static void End(); sl@0: sl@0: static void LaunchGroup(CTestProgram** aGroup, TUint aCount); sl@0: static void SpawnGroup(CTestProgram** aGroup, TUint aCount); sl@0: sl@0: CTestProgram(const TDesC& aName); sl@0: sl@0: void Exec(const TDesC& aFile, TAny* args, TInt size); sl@0: sl@0: void Spawn(TUint aCount); sl@0: void Wait(); sl@0: sl@0: void Launch(TUint aCount); sl@0: sl@0: virtual void Run(TUint aCount) = 0; sl@0: sl@0: void Panic (TInt aError, char* aCond, char* aFile, TInt aLine); sl@0: sl@0: private: sl@0: static TInt ThreadEntry(TAny*); sl@0: sl@0: void Panic(); sl@0: sl@0: const TDesC& iName; sl@0: sl@0: TUint iCount; sl@0: TRequestStatus iStatus; sl@0: TRequestStatus iDestroyStatus; sl@0: sl@0: TThreadId iThreadId; sl@0: sl@0: TInt iError; sl@0: char* iCond; sl@0: char* iFile; sl@0: TInt iLine; sl@0: }; sl@0: sl@0: #endif