0
|
1 |
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#ifndef __T_FRAMEWORK_H__
|
|
17 |
#define __T_FRAMEWORK_H__
|
|
18 |
|
|
19 |
#include <e32std.h>
|
|
20 |
#include <e32base.h>
|
|
21 |
#include <e32property.h>
|
|
22 |
|
|
23 |
#define TF_ERROR(aRes, aCond) ((void) ((aCond) || (CTestProgram::Panic(aRes, #aCond, __FILE__, __LINE__), 0)))
|
|
24 |
#define TF_ERROR_PROG(aProg, aRes, aCond) ((void) ((aCond) || ((aProg)->Panic(aRes, #aCond, __FILE__, __LINE__), 0)))
|
|
25 |
|
|
26 |
class CTestProgram : public CBase
|
|
27 |
{
|
|
28 |
public:
|
|
29 |
|
|
30 |
static void Start();
|
|
31 |
static void End();
|
|
32 |
|
|
33 |
static void LaunchGroup(CTestProgram** aGroup, TUint aCount);
|
|
34 |
static void SpawnGroup(CTestProgram** aGroup, TUint aCount);
|
|
35 |
|
|
36 |
CTestProgram(const TDesC& aName);
|
|
37 |
|
|
38 |
void Exec(const TDesC& aFile, TAny* args, TInt size);
|
|
39 |
|
|
40 |
void Spawn(TUint aCount);
|
|
41 |
void Wait();
|
|
42 |
|
|
43 |
void Launch(TUint aCount);
|
|
44 |
|
|
45 |
virtual void Run(TUint aCount) = 0;
|
|
46 |
|
|
47 |
void Panic (TInt aError, char* aCond, char* aFile, TInt aLine);
|
|
48 |
|
|
49 |
private:
|
|
50 |
static TInt ThreadEntry(TAny*);
|
|
51 |
|
|
52 |
void Panic();
|
|
53 |
|
|
54 |
const TDesC& iName;
|
|
55 |
|
|
56 |
TUint iCount;
|
|
57 |
TRequestStatus iStatus;
|
|
58 |
TRequestStatus iDestroyStatus;
|
|
59 |
|
|
60 |
TThreadId iThreadId;
|
|
61 |
|
|
62 |
TInt iError;
|
|
63 |
char* iCond;
|
|
64 |
char* iFile;
|
|
65 |
TInt iLine;
|
|
66 |
};
|
|
67 |
|
|
68 |
#endif
|