|
1 // Copyright (c) 2007-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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Example CTestStep derived implementation |
|
15 // |
|
16 |
|
17 |
|
18 |
|
19 /** |
|
20 @file te_perf.cpp |
|
21 @internalTechnology |
|
22 */ |
|
23 #include "te_perf.h" |
|
24 #include "te_ostv2integsuite_defs.h" |
|
25 #include <e32math.h> |
|
26 #include "te_perfresultscollector.h" |
|
27 #include <hal.h> |
|
28 #include "te_lightlogger.h" |
|
29 #include "lightlogger.h" |
|
30 #include "te_tracecontrolcmds.h" |
|
31 #include "te_perfcsvgenerator.h" |
|
32 using namespace Ulogger; //CA:added so can use old ulogger api |
|
33 |
|
34 //////////////////////////////////////////////////////////////////////// |
|
35 //////////////////////////////////////////////////////////////////////// |
|
36 ////////////////////// UPT OUTPUT PLUGIN CONFIG CLASS/////////////////// |
|
37 //////////////////////////////////////////////////////////////////////// |
|
38 //////////////////////////////////////////////////////////////////////// |
|
39 CPluginRunConfig::CPluginRunConfig() |
|
40 { |
|
41 /*Constructor*/ |
|
42 //iPluginName=0; // initialize to nothing so can tell if test worked? pickup defaults here? |
|
43 //iPluginConfiguration=0; //set as default=file |
|
44 //iPluginKey=0; |
|
45 //iPluginValue=0; |
|
46 //iTestType; |
|
47 iDataSize=-1; //this is the amount of data to be sent through the output plugin |
|
48 iIteration=1; |
|
49 |
|
50 } |
|
51 |
|
52 CPluginRunConfig::~CPluginRunConfig() |
|
53 { |
|
54 /*Destructor*/ |
|
55 } |
|
56 |
|
57 //////////////////////////////////////////////////////////////////////// |
|
58 //////////////////////////////////////////////////////////////////////// |
|
59 |
|
60 CTCMPerformanceWrapper::~CTCMPerformanceWrapper() |
|
61 /** |
|
62 * Destructor |
|
63 */ |
|
64 { |
|
65 delete iPluginRunConfig; |
|
66 } |
|
67 |
|
68 CTCMPerformanceWrapper::CTCMPerformanceWrapper() |
|
69 /** |
|
70 * Constructor |
|
71 */ |
|
72 { |
|
73 TRunConfigurer::Init(iApiRunConfig); |
|
74 iPluginRunConfig = new(ELeave) CPluginRunConfig; |
|
75 } |
|
76 |
|
77 |
|
78 CTCMPerformanceWrapper* CTCMPerformanceWrapper::NewLC() |
|
79 { |
|
80 CTCMPerformanceWrapper* self = new (ELeave)CTCMPerformanceWrapper(); |
|
81 CleanupStack::PushL(self); |
|
82 self->ConstructL(); |
|
83 return self; |
|
84 } |
|
85 |
|
86 CTCMPerformanceWrapper* CTCMPerformanceWrapper::NewL() |
|
87 { |
|
88 CTCMPerformanceWrapper* self=CTCMPerformanceWrapper::NewLC(); |
|
89 CleanupStack::Pop(); // self; |
|
90 return self; |
|
91 } |
|
92 |
|
93 void CTCMPerformanceWrapper::ConstructL() |
|
94 { |
|
95 } |
|
96 |
|
97 TAny* CTCMPerformanceWrapper::GetObject() |
|
98 { |
|
99 return NULL; |
|
100 } |
|
101 TBool CTCMPerformanceWrapper::DoCommandL( const TTEFFunction& /*aCommand*/, |
|
102 const TTEFSectionName& aSection, |
|
103 const TInt /*aAsyncErrorIndex*/) |
|
104 { |
|
105 if(BlockResult()==EPass) |
|
106 { |
|
107 TBool doapicalltests; |
|
108 TBool dooutputplugintests; |
|
109 TBool dothroughputtests; |
|
110 TBool dobuffersizetests;//****to be implemented |
|
111 TBool dobuffermodetests;//****to be implemented |
|
112 |
|
113 //collect which testypes to run |
|
114 if(!GetBoolFromConfig(aSection,_L("runapicalltests"), doapicalltests)) |
|
115 doapicalltests=ETrue; |
|
116 if(!GetBoolFromConfig(aSection,_L("runoutputplugintests"), dooutputplugintests)) |
|
117 dooutputplugintests=ETrue; |
|
118 if(!GetBoolFromConfig(aSection,_L("runthroughputtests"), dothroughputtests)) |
|
119 dothroughputtests=ETrue; |
|
120 if(!GetBoolFromConfig(aSection,_L("runbuffersizetests"), dobuffersizetests)) |
|
121 dobuffersizetests=ETrue; |
|
122 if(!GetBoolFromConfig(aSection,_L("runbuffermodetests"), dobuffermodetests)) |
|
123 dobuffermodetests=ETrue; |
|
124 |
|
125 TInt pluginOnlyTests=0; |
|
126 //run api tests |
|
127 if(doapicalltests) |
|
128 SetBlockResult(DoApiTests(aSection)); |
|
129 |
|
130 if(dooutputplugintests) |
|
131 { |
|
132 pluginOnlyTests=1; |
|
133 SetBlockResult(DoPluginTests(pluginOnlyTests, aSection)); |
|
134 } |
|
135 |
|
136 if(dothroughputtests) |
|
137 { |
|
138 pluginOnlyTests=2; |
|
139 SetBlockResult(DoPluginTests(pluginOnlyTests, aSection)); |
|
140 } |
|
141 |
|
142 /* |
|
143 * Implement these in the next iteration |
|
144 * |
|
145 * if(dobuffersizetests) |
|
146 SetBlockResult(DoBufferSizeTests()); |
|
147 if(dobuffermodetests) |
|
148 SetBlockResult(DoBufferModeTests()); |
|
149 * |
|
150 * |
|
151 * |
|
152 */ |
|
153 |
|
154 } |
|
155 return ETrue; |
|
156 } |
|
157 |
|
158 TVerdict CTCMPerformanceWrapper::DoApiTests(const TTEFSectionName& aSection) |
|
159 { |
|
160 //initialize and create test run parameters |
|
161 //*******this is quite ugly and could be tidied up into a new routine so isnt in main test step |
|
162 TInt minapiidvalue=0; |
|
163 TInt maxapiidvalue=0; |
|
164 TInt pcBool=0; |
|
165 THasProgramCounter minpcvalue=ENoProgramCounter; |
|
166 THasProgramCounter maxpcvalue=ENoProgramCounter; |
|
167 TInt contextBool=0; |
|
168 THasThreadIdentification mincontextvalue=ENoThreadIdentification; |
|
169 THasThreadIdentification maxcontextvalue=ENoThreadIdentification; |
|
170 TBool usesampleevp = EFalse; |
|
171 TInt mindatasizevalue=0; |
|
172 TInt maxdatasizevalue=0; |
|
173 TInt dataincrement=1; |
|
174 TBool minexecutionvalue=EFalse; |
|
175 TBool typicalexecutionvalue=EFalse; |
|
176 TBool testclassificationfiltering=EFalse; |
|
177 TBool testmoduleidfiltering=EFalse; |
|
178 TBool mintestclassificationmatch=ETrue; |
|
179 TBool maxtestclassificationmatch=ETrue; |
|
180 TBool mintestmoduleidmatch=EFalse; |
|
181 TBool maxtestmoduleidmatch=EFalse; |
|
182 TBool appendvalue=ETrue; |
|
183 TInt testtype = 0; |
|
184 |
|
185 TBool traceenabledvalue=EFalse; |
|
186 |
|
187 if(BlockResult() == EPass) |
|
188 { |
|
189 //TInt error=KErrNotSupported; |
|
190 |
|
191 //fetch user defined fields from config file (need to ensure there are defaults in the test suite) |
|
192 //any missing fields, etc, assign default values |
|
193 //*******remove magic numbers and set as KLit's |
|
194 INFO_PRINTF1(_L("Fetch user-defined values from config file")); |
|
195 |
|
196 //initial api |
|
197 if(!GetIntFromConfig(aSection,_L("minapiid"),minapiidvalue)) |
|
198 minapiidvalue=0; |
|
199 |
|
200 //final api |
|
201 if(!GetIntFromConfig(aSection,_L("maxapiid"),maxapiidvalue)) |
|
202 maxapiidvalue=minapiidvalue; |
|
203 |
|
204 //pc parameters |
|
205 if(!GetIntFromConfig(aSection,_L("pc"),pcBool)) |
|
206 { |
|
207 minpcvalue=EAddProgramCounter; |
|
208 maxpcvalue=ENoProgramCounter; |
|
209 } |
|
210 else |
|
211 { |
|
212 if(pcBool == 1) |
|
213 { |
|
214 maxpcvalue=minpcvalue=EAddProgramCounter; |
|
215 } |
|
216 else |
|
217 { |
|
218 maxpcvalue=minpcvalue=ENoProgramCounter; |
|
219 } |
|
220 } |
|
221 |
|
222 //context paramaters |
|
223 if(!GetIntFromConfig(aSection,_L("context"),contextBool)) |
|
224 { |
|
225 mincontextvalue=EAddThreadIdentification; |
|
226 maxcontextvalue=ENoThreadIdentification; |
|
227 } |
|
228 else |
|
229 { |
|
230 if(contextBool == 1) |
|
231 { |
|
232 maxcontextvalue=mincontextvalue=EAddThreadIdentification; |
|
233 } |
|
234 else |
|
235 maxcontextvalue=mincontextvalue=ENoThreadIdentification; |
|
236 } |
|
237 //loop over data or use sample evp |
|
238 if(!GetBoolFromConfig(aSection,_L("testsampleevp"),usesampleevp)) |
|
239 usesampleevp=ETrue; |
|
240 |
|
241 //data size parameters |
|
242 if(!GetIntFromConfig(aSection,_L("minevp"),mindatasizevalue)) |
|
243 mindatasizevalue=0; |
|
244 if(!GetIntFromConfig(aSection,_L("maxevp"),maxdatasizevalue)) |
|
245 maxdatasizevalue=mindatasizevalue; |
|
246 if(maxdatasizevalue!=mindatasizevalue) |
|
247 { |
|
248 if(!GetIntFromConfig(aSection,_L("evpincrement"),dataincrement)) |
|
249 dataincrement=(maxdatasizevalue-mindatasizevalue)/(10-1); |
|
250 } |
|
251 |
|
252 //minimum execution test |
|
253 if(!GetBoolFromConfig(aSection,_L("minexecutiontime"),minexecutionvalue)) |
|
254 minexecutionvalue=ETrue; |
|
255 |
|
256 //typical execution test |
|
257 if(!GetBoolFromConfig(aSection,_L("reasonablemaxexecutiontime"),typicalexecutionvalue)) |
|
258 typicalexecutionvalue=ETrue; |
|
259 |
|
260 //testprimary filter |
|
261 if(!GetBoolFromConfig(aSection,_L("testwithclassificationfilteringenabled"),testclassificationfiltering)) |
|
262 testclassificationfiltering=ETrue; |
|
263 |
|
264 //testsecondary filter |
|
265 if(!GetBoolFromConfig(aSection,_L("testwithmoduleidfilteringenabled"),testmoduleidfiltering)) |
|
266 testmoduleidfiltering=ETrue; |
|
267 |
|
268 //testclassificationfiltermatch |
|
269 if(!GetBoolFromConfig(aSection,_L("testwithclassificationfiltermatchestrace "),mintestclassificationmatch)) |
|
270 { |
|
271 mintestclassificationmatch=ETrue; |
|
272 maxtestclassificationmatch=EFalse; |
|
273 } |
|
274 else |
|
275 maxtestclassificationmatch=mintestclassificationmatch; |
|
276 |
|
277 //testmoduleidfiltermatch |
|
278 if(!GetBoolFromConfig(aSection,_L("testwithmoduleidfiltermatchestrace"),mintestmoduleidmatch)) |
|
279 { |
|
280 mintestmoduleidmatch=ETrue; |
|
281 maxtestmoduleidmatch=EFalse; |
|
282 } |
|
283 else |
|
284 maxtestmoduleidmatch=mintestmoduleidmatch; |
|
285 |
|
286 |
|
287 if(!GetBoolFromConfig(aSection,_L("append"),appendvalue)) |
|
288 appendvalue = EFalse; |
|
289 |
|
290 traceenabledvalue = EFalse; |
|
291 |
|
292 #ifdef TE_UPT_TRACE_ENABLED //or could ifdef on SYMBIAN_TRACE_EXECUTABLE_INCLUDE --especially if there's likely to be other configs |
|
293 traceenabledvalue = ETrue; |
|
294 #endif |
|
295 |
|
296 //mass of nested for loops... :( |
|
297 |
|
298 //do the test |
|
299 |
|
300 INFO_PRINTF1(_L("Do the API tests")); |
|
301 CApiCallTest apitest; |
|
302 CUptResults manageresults; |
|
303 |
|
304 |
|
305 // write data to csv |
|
306 INFO_PRINTF1(_L("Write the api results to csv")); |
|
307 |
|
308 |
|
309 //create the ULogger session |
|
310 RULogger logger; |
|
311 CUptULogger loggerCommand; |
|
312 TInt result= 0; |
|
313 result =logger.Connect(); |
|
314 INFO_PRINTF2(_L("Connection to Ulogger: %d, attempt: 1"), result); |
|
315 if (result!=KErrNone) |
|
316 { |
|
317 INFO_PRINTF1(_L("Connection to Ulogger failed. Will try to connect max. 10 times")); |
|
318 for (TInt i=2; i<12;i++) |
|
319 { |
|
320 User::After(1000); |
|
321 result = logger.Connect(); |
|
322 INFO_PRINTF3(_L("Connection to Ulogger: %d, attempt: %d"), result, i); |
|
323 if (result==KErrNone) |
|
324 { |
|
325 break; |
|
326 } |
|
327 } |
|
328 } |
|
329 CClearConfig configIni; |
|
330 configIni.Clear(logger); |
|
331 |
|
332 //put in test over API CALLS |
|
333 testtype=0; |
|
334 |
|
335 if(usesampleevp==0) |
|
336 { |
|
337 #define LOOP_EVP |
|
338 } |
|
339 for(TInt runapiid=minapiidvalue; runapiid<=maxapiidvalue; runapiid++) |
|
340 { |
|
341 for(TInt runpc=minpcvalue; runpc<=maxpcvalue; runpc++) |
|
342 { |
|
343 for(TInt runcontext=mincontextvalue; runcontext<=maxcontextvalue; runcontext++) |
|
344 { |
|
345 TInt rundatasize=mindatasizevalue; |
|
346 #ifdef LOOP_EVP |
|
347 for(rundatasize=mindatasizevalue; rundatasize<=maxdatasizevalue; rundatasize=rundatasize+dataincrement) |
|
348 { |
|
349 #endif |
|
350 { |
|
351 for(TBool runclassificationfiltermatch=mintestclassificationmatch; runclassificationfiltermatch<=maxtestclassificationmatch; runclassificationfiltermatch++) |
|
352 { |
|
353 for(TBool runmoduleidfiltermatch=mintestmoduleidmatch; runmoduleidfiltermatch<=maxtestmoduleidmatch; runmoduleidfiltermatch++) |
|
354 { |
|
355 |
|
356 //now set the parameters to pass to the test step |
|
357 TRunConfigurer::SetRunParams(iApiRunConfig, runapiid, (THasThreadIdentification) runcontext, (THasProgramCounter) runpc); |
|
358 TRunConfigurer::SetRunConfigs(iApiRunConfig, testclassificationfiltering, testmoduleidfiltering, runclassificationfiltermatch, runmoduleidfiltermatch, minexecutionvalue, typicalexecutionvalue, EFalse, EFalse, EFalse); |
|
359 |
|
360 //start the ULogger session with filter settings as specified by the user |
|
361 __TEST_LOG("about to start ulogger session"); |
|
362 |
|
363 TInt error=loggerCommand.StartFileL(logger,testclassificationfiltering, testmoduleidfiltering, runclassificationfiltermatch, runmoduleidfiltermatch); |
|
364 if(error) |
|
365 { |
|
366 INFO_PRINTF2(_L("start logger returns %d"), error); |
|
367 SetBlockResult(EFail); |
|
368 } |
|
369 |
|
370 TApiTestResult apitestresult; |
|
371 apitestresult.iRunConfigs = iApiRunConfig; //shallow opy should suffice as we use it between kernel and user side as well. |
|
372 apitestresult.iRunResults.iTraceEnabled = traceenabledvalue; |
|
373 |
|
374 //do the test |
|
375 INFO_PRINTF2(_L("Testing API %d"), iApiRunConfig.iApiId); |
|
376 error = apitest.CachedTraceTime(iApiRunConfig, apitestresult); |
|
377 if(error) |
|
378 { |
|
379 INFO_PRINTF2(_L("ERROR: CachedTraceTime failed, error %d"), error); |
|
380 SetBlockResult(EFail); |
|
381 } |
|
382 error = apitest.NonCachedTraceTime(iApiRunConfig, apitestresult); |
|
383 if(error) |
|
384 { |
|
385 INFO_PRINTF2(_L("ERROR: NonCachedTraceTime failed, error %d"), error); |
|
386 SetBlockResult(EFail); |
|
387 } |
|
388 error = apitest.StackUsage(iApiRunConfig, apitestresult); |
|
389 if(error) |
|
390 { |
|
391 INFO_PRINTF2(_L("ERROR: StackUsage failed, error %d"), error); |
|
392 SetBlockResult(EFail); |
|
393 } |
|
394 |
|
395 //(apitest.DoTestL(*iApiRunConfig))->Copy(apitestresult); |
|
396 //stop the ULogger session |
|
397 __TEST_LOG("about to stop ulogger session"); |
|
398 loggerCommand.StopAndDeleteFile(logger); |
|
399 |
|
400 //collect the results |
|
401 //INFO_PRINTF1(_L("Collect the api results")); |
|
402 |
|
403 //store the API test result |
|
404 manageresults.StoreApiResultsL(apitestresult); |
|
405 //error = manageresults.StoreApiResultsL(apitestresult); |
|
406 //if(error) |
|
407 //{ |
|
408 //INFO_PRINTF1(_L("Write the api results")); |
|
409 //SetBlockResult(EFail); |
|
410 //} |
|
411 __UHEAP_MARK; |
|
412 manageresults.WriteUptResultsL(KApiCSVFile, appendvalue, testtype); |
|
413 __UHEAP_MARKEND; |
|
414 } |
|
415 |
|
416 } |
|
417 #ifdef LOOP_EVP |
|
418 } |
|
419 #endif |
|
420 } |
|
421 } |
|
422 } |
|
423 } |
|
424 result = logger.Connect(); |
|
425 INFO_PRINTF2(_L("Connection to Ulogger: %d, attempt: 1"), result); |
|
426 if (result!=KErrNone) |
|
427 { |
|
428 INFO_PRINTF1(_L("Connection to Ulogger failed. Will try to connect max. 10 times")); |
|
429 for (TInt i=2; i<12;i++) |
|
430 { |
|
431 User::After(1000); |
|
432 result = logger.Connect(); |
|
433 INFO_PRINTF3(_L("Connection to Ulogger: %d, attempt: %d"), result, i); |
|
434 if (result==KErrNone) |
|
435 { |
|
436 break; |
|
437 } |
|
438 } |
|
439 } |
|
440 configIni.Clear(logger); |
|
441 } |
|
442 //put in all the error returns |
|
443 //put in test step result returns |
|
444 INFO_PRINTF1(_L("End of test run")); |
|
445 return BlockResult(); |
|
446 } |
|
447 |
|
448 TVerdict CTCMPerformanceWrapper::DoPluginTests(const TInt& aPluginOnly, const TTEFSectionName& aSection) |
|
449 { |
|
450 //define default plugin configurations |
|
451 _LIT(KDefaultPlugin,"uloggerfileplugin"); |
|
452 _LIT(KOutputPath, "output_path"); |
|
453 _LIT(KLogDefaultFileName, "C:\\logs\\defaultplugin.utf"); |
|
454 _LIT(KOutputCSVFile,"c:\\te_plugintestresults.csv"); |
|
455 |
|
456 //create lightlogger file for the timestamps |
|
457 //NB this is a temporary solution until the next iteration |
|
458 //where ulogger source itself will be instrumented with test code |
|
459 |
|
460 __CREATE_LOG(false); |
|
461 __LOG("About to record plugin timestamps"); |
|
462 __HIRES_RESOLUTION; |
|
463 |
|
464 //initialize and create test run parameters |
|
465 TInt plugindata=0; |
|
466 TInt pluginiterations=0; |
|
467 TBool appendvalue; |
|
468 TInt testtype = 0; |
|
469 TPtrC plugintempname(KDefaultPlugin); |
|
470 TPtrC plugintempkey(KOutputPath); |
|
471 TPtrC plugintempvalue(KLogDefaultFileName); |
|
472 TPtrC8 plugintestype; |
|
473 |
|
474 //first identify the testtype |
|
475 if(aPluginOnly==1) |
|
476 { |
|
477 testtype=1; |
|
478 plugintestype.Set(KOutputPluginTest); |
|
479 __LOG("NB: recording plugin only timestamps"); |
|
480 } |
|
481 else |
|
482 { |
|
483 testtype=2; |
|
484 plugintestype.Set(KThroughputTest); |
|
485 __LOG("NB: recording full throughput timestamps"); |
|
486 } |
|
487 |
|
488 |
|
489 //TInt ConfigureOutputPlugin(const RPointerArray<TPluginConfiguration>& aSettings); if>0 |
|
490 //currently this test suite assumes that there is only one set of configuration settings |
|
491 |
|
492 |
|
493 //Collect the output plugin test run configuration |
|
494 |
|
495 //plugin name |
|
496 if(!GetStringFromConfig(aSection,_L("plugintestused"),plugintempname)) |
|
497 { |
|
498 ; |
|
499 } |
|
500 |
|
501 //the following three lines are an irritating get around to sort out the fact that |
|
502 //the routine for GetStringFromConfig() only works with TPtrC16 and ULogger expects TPtrC8 |
|
503 TBuf8<0x100> pluginname; |
|
504 pluginname.Copy(plugintempname); |
|
505 |
|
506 |
|
507 //plugin configurations |
|
508 if(!GetStringFromConfig(aSection,_L("plugintestconfigurationkey"),plugintempkey)) |
|
509 { |
|
510 ; |
|
511 } |
|
512 //the routine for GetStringFromConfig() only works with TPtrC16 and ULogger expects TPtrC8 |
|
513 TBuf8<0x100> pluginkey; |
|
514 pluginkey.Copy(plugintempkey); |
|
515 |
|
516 if(!GetStringFromConfig(aSection,_L("plugintestconfigurationvalue"),plugintempvalue)) |
|
517 { |
|
518 ; |
|
519 } |
|
520 //the routine for GetStringFromConfig() only works with TPtrC16 and ULogger expects TPtrC8 |
|
521 TBuf8<0x100> pluginvalue; |
|
522 pluginvalue.Copy(plugintempvalue); |
|
523 |
|
524 //datasize to pass through plugin in bytes |
|
525 if(!GetIntFromConfig(aSection,_L("plugintestdatasize"),plugindata)) |
|
526 plugindata=1024; |
|
527 |
|
528 //number of test iterations for stress test over time |
|
529 if(!GetIntFromConfig(aSection,_L("plugintestiterations"), pluginiterations)) |
|
530 pluginiterations=1; |
|
531 |
|
532 //option for appending to results file |
|
533 if(!GetBoolFromConfig(aSection,_L("append"),appendvalue)) |
|
534 appendvalue=ETrue; |
|
535 |
|
536 TBool traceon=ETrue; |
|
537 #ifndef TE_UPT_TRACE_ENABLED //or could ifdef on SYMBIAN_TRACE_EXECUTABLE_INCLUDE --especially if there's likely to be other configs |
|
538 traceon=EFalse; |
|
539 INFO_PRINTF1(_L("WARNING! Tracing is disabled so output plugin tests not run ")); |
|
540 #endif |
|
541 |
|
542 //mass of nested for loops... :( |
|
543 if(traceon) |
|
544 { |
|
545 //do the test |
|
546 INFO_PRINTF1(_L("Do the plugin tests")); |
|
547 CPluginTestResult plugintestresult; |
|
548 CPluginTests plugintest; |
|
549 CUptResults manageresults; |
|
550 |
|
551 |
|
552 //create the ULogger session |
|
553 RULogger logger; |
|
554 CUptULogger loggerCommand; |
|
555 |
|
556 //set the run parameters |
|
557 |
|
558 iPluginRunConfig->iPluginName.Set(pluginname); |
|
559 iPluginRunConfig->iPluginConfiguration.SetKey(pluginkey); |
|
560 iPluginRunConfig->iPluginConfiguration.SetValue(pluginvalue); |
|
561 iPluginRunConfig->iPluginKey.Set(pluginkey); |
|
562 iPluginRunConfig->iPluginValue.Set(pluginvalue); |
|
563 iPluginRunConfig->iTestType.Set(plugintestype); |
|
564 iPluginRunConfig->iDataSize=plugindata; |
|
565 TBool classificationFiltering = ETrue; |
|
566 TBool moduleIdFiltering = ETrue; |
|
567 TBool classificationFilterMatch = ETrue; |
|
568 TBool moduleIdFilterMatch = ETrue; |
|
569 |
|
570 //we force this to be hardcoded as it makes no sense to have a mismatch here |
|
571 //i.e. to have trace compiled in but filters disabled |
|
572 |
|
573 //iterates over tests for stress testing |
|
574 TInt error=KErrNone; |
|
575 |
|
576 for(TInt iterate=1; iterate<=pluginiterations; iterate++) |
|
577 { |
|
578 |
|
579 iPluginRunConfig->iIteration=iterate; |
|
580 |
|
581 //start the ULogger session with filter settings as specified by the user |
|
582 //__TEST_LOG("about to start ulogger session"); |
|
583 INFO_PRINTF1(_L("about to start logger")); |
|
584 |
|
585 error=loggerCommand.StartGeneralL(logger, iPluginRunConfig->iPluginName, iPluginRunConfig->iPluginConfiguration, classificationFiltering, moduleIdFiltering, classificationFilterMatch, moduleIdFilterMatch); |
|
586 |
|
587 INFO_PRINTF2(_L("start logger returns %d"), error); |
|
588 |
|
589 //do the test |
|
590 plugintestresult.Copy(*plugintest.DoTestL(*iPluginRunConfig)); |
|
591 |
|
592 //stop the ULogger session |
|
593 //__TEST_LOG("about to stop ulogger session"); |
|
594 loggerCommand.Stop(logger); |
|
595 |
|
596 //collect the results |
|
597 INFO_PRINTF1(_L("Collect the plugin results")); |
|
598 |
|
599 //store the plugin test result |
|
600 manageresults.StorePluginResultsL(plugintestresult); |
|
601 // write data to csv |
|
602 INFO_PRINTF1(_L("Write the plugin results to csv")); |
|
603 manageresults.WriteUptResultsL(KOutputCSVFile, appendvalue, testtype); |
|
604 |
|
605 } |
|
606 SetBlockResult(EFail); |
|
607 if(error==KErrNone) |
|
608 SetBlockResult(EPass); |
|
609 |
|
610 } |
|
611 |
|
612 return BlockResult(); |
|
613 } |
|
614 |
|
615 |
|
616 TVerdict CTCMPerformanceWrapper::DoBufferSizeTests() |
|
617 { |
|
618 TInt error=KErrNone; |
|
619 SetBlockResult(EFail); |
|
620 if(error==KErrNone) |
|
621 SetBlockResult(EPass); |
|
622 return BlockResult(); |
|
623 } |
|
624 |
|
625 TVerdict CTCMPerformanceWrapper::DoBufferModeTests() |
|
626 { |
|
627 TInt error=KErrNone; |
|
628 SetBlockResult(EFail); |
|
629 if(error==KErrNone) |
|
630 SetBlockResult(EPass); |
|
631 return BlockResult(); |
|
632 } |
|
633 |
|
634 |