|
1 // Copyright (c) 2006-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 // Definitions for the run mode debug tests |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalTechnology |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef RMDEBUG_MULTI_AGENT_H |
|
25 #define RMDEBUG_MULTI_AGENT_H |
|
26 |
|
27 #include <u32hal.h> |
|
28 #include <f32file.h> |
|
29 #include <rm_debug_api.h> |
|
30 |
|
31 using namespace Debug; |
|
32 |
|
33 _LIT(KLaunchSemaphoreName, "t_rmdebug_launch_semaphore"); |
|
34 _LIT(KLaunchSemaphoreSearchString, "t_rmdebug_launch_semaphore*"); |
|
35 |
|
36 // Currently the targets are instances of t_rmdebug_app.exe |
|
37 _LIT(KTargetExe,"z:\\sys\\bin\\t_rmdebug_app%d.exe"); |
|
38 |
|
39 _LIT(KTargetOptions,"-f%d -a%d"); |
|
40 |
|
41 // If changing this, make sure there are enough apps built/in the rom |
|
42 const TInt KNumApps = 5; |
|
43 |
|
44 // Default CPU execution for Agent |
|
45 const TInt KAgentCpu = 0; |
|
46 |
|
47 // Workaround to ensure we have the same agent binary when running multiple agents |
|
48 const TInt KTargetOffset = 0; |
|
49 |
|
50 class CAgentAsyncEvent; |
|
51 |
|
52 /** |
|
53 @Class CRunModeAgent |
|
54 |
|
55 The basic run mode agent |
|
56 */ |
|
57 class CMultiAgent : public CBase |
|
58 { |
|
59 public: |
|
60 static CMultiAgent* NewL(); |
|
61 ~CMultiAgent(); |
|
62 void ClientAppL(); |
|
63 RSecuritySvrSession& DebugDriver() { return iServSession; }; |
|
64 void HandleEvent(TEventInfo& aSEventInfo); |
|
65 |
|
66 public: |
|
67 TInt GetLaunchCompleted() const { return iLaunchCompleted; } |
|
68 TInt GetNumApps() const { return iNumApps; } |
|
69 TInt GetTargetOffset() const { return iTargetNameOffset; } |
|
70 |
|
71 private: |
|
72 CMultiAgent(); |
|
73 void ConstructL(); |
|
74 TInt StartTest(); |
|
75 TInt LaunchProcess(RProcess& aProcess, const TDesC& aExeName, const TDesC& aCommandLine); |
|
76 |
|
77 private: |
|
78 |
|
79 /** |
|
80 * CPU agent executes on; by default this is 0 |
|
81 */ |
|
82 TInt iAgentCpuNo; |
|
83 |
|
84 /* |
|
85 * Offset for running multiple targets using the same agent |
|
86 */ |
|
87 TInt iTargetNameOffset; |
|
88 |
|
89 /** |
|
90 * Number of applications/targets per agent |
|
91 */ |
|
92 TInt iNumApps; |
|
93 |
|
94 /** |
|
95 * Flag used for terminating the event handling for a target |
|
96 */ |
|
97 TInt iLaunchCompleted; |
|
98 |
|
99 /* |
|
100 * Handle to DSS |
|
101 */ |
|
102 RSecuritySvrSession iServSession; |
|
103 |
|
104 /** |
|
105 * Array to target parameters required by the agent |
|
106 */ |
|
107 RPointerArray<CAgentAsyncEvent> iTargetList; |
|
108 }; |
|
109 |
|
110 #endif // RMDEBUG_MULTI_AGENT_H |