Update contrib.
1 // Copyright (c) 2005-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 "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #if (!defined __LOCALTESTBASE_H__)
23 #define __LOCALTESTBASE_H__
26 #include <ecom/ecom.h>
27 #include <e32msgqueue.h>
28 #include <test/testexecuteserverbase.h>
29 //#include <test/ttmsgraphicsstep.h>
30 #include "egltest_commscommon.h"
34 GLDEF_C TInt E32Main();
37 CEglEndpointTestServer Server encapsulates the functionality required to execute Test Execute based test cases for the EGL endpoint extension.
39 class CEglEndpointTestServer : public CTestServer
42 static CEglEndpointTestServer* NewL();
44 virtual CTestStep* CreateTestStep(const TDesC& aStepName);
49 Logger used to log result of every GRAPHICS-EGL-* test to
50 file, even in event of panic. wrapped by CLocalTestStepBase.
52 class CTestIdResultLogger : public CBase
55 typedef TBuf<8> TTestId;
58 static CTestIdResultLogger* NewL(CTestExecuteLogger& aLogger);
59 ~CTestIdResultLogger();
61 void RegisterTestIdsL(const TDesC& aTestString);
62 void SetCurrentTestIds(const TDesC& aTestString);
63 void LogResult(TVerdict aVerdict);
66 CTestIdResultLogger(CTestExecuteLogger& aLogger);
68 static TInt PanicMonitorMain(TAny* aSelf);
69 void PanicMonitorMainL();
70 void LogResult(CTestExecuteLogger& aLogger, const TTestId& aTestId, const TDesC& aVerdict);
73 const TThreadId iOriginalThread;
74 RThread iPanicMonitor;
75 TRequestStatus* iCloseMonitor;
76 CTestExecuteLogger& iLogger;
77 RArray<TTestId> iRegisteredTestIds;
78 RArray<TTestId> iCurrentTestIds;
83 Base class for Egl test steps where the testing is done in a render stage
85 NONSHARABLE_CLASS(CLocalTestStepBase) : public CTestStep //CTTMSGraphicsStep
89 CLocalTestStepBase(const TTestUid aUid);
90 IMPORT_C virtual ~CLocalTestStepBase();
91 TVerdict doTestStepPreambleL(); //setup the queues
92 TVerdict doTestStepPostambleL(); //close the queues
94 //Functions to control remote test.
95 //If we are not currently in a test step (ie between StartRemoteTestStepL() and
96 //EndRemoteTestStepL(), this includes the case where StartRemoteTestStepL() fails),
97 //the framework does not allow running test cases. It will instead return EFail
98 //immediately to the caller.
100 TVerdict StartRemoteTestStep(const TRemoteTestParams& aMessageIn);
101 TVerdict RunRemoteTestCase(TInt aTestCase, const TRemoteTestParams& aMessageIn);
102 TVerdict EndRemoteTestStep(const TRemoteTestParams& aMessageIn);
104 virtual void DoPreambleL();
105 virtual void DoPostambleL();
107 void RegisterTestIdsL(const TDesC& aTestString);
108 void SetCurrentTestIds(const TDesC& aTestString);
109 void SetTestStepResult(TVerdict aVerdict);
112 RMsgQueue<TRemoteTestResult> iResultOutQueue;
113 RMsgQueue<TRemoteTestParamsPacket> iParamsInQueue;
116 const TTestUid iTestId;
117 TInt iCurrentTestCase;
119 TVerdict iTestIdVerdict;
120 TBool iHasCurrentTestIds;
121 CTestIdResultLogger* iResultLog;
125 #endif // __EGLENDPOINTTESTSERVER_H__