25 #include <featmgr/featurecontrol.h> |
25 #include <featmgr/featurecontrol.h> |
26 #include <hal.h> |
26 #include <hal.h> |
27 #include "characterisation_steps.h" |
27 #include "characterisation_steps.h" |
28 #include "efm_teststepbase.h" |
28 #include "efm_teststepbase.h" |
29 |
29 |
|
30 |
|
31 TBool SkipPerformanceTest = EFalse; |
|
32 const TInt KPlatSimUid = 0x20029a73; //0x20029a73 will be changed soon once PlatSim get its own uid. |
|
33 |
30 // This is the base class for some of our characterisation tests. |
34 // This is the base class for some of our characterisation tests. |
31 // Creates an RFeatureControl object, finds out what the fast counter |
35 // Creates an RFeatureControl object, finds out what the fast counter |
32 // frequency is and gets the timeout for this test. |
36 // frequency is and gets the timeout for this test. |
33 TVerdict CCharacteriseBaseStep :: doTestStepPreambleL() |
37 TVerdict CCharacteriseBaseStep :: doTestStepPreambleL() |
34 { |
38 { |
35 // First find out the granularity of the system clock.. |
39 |
36 HAL::Get(HALData::EFastCounterFrequency, icountfreq); |
|
37 INFO_PRINTF2(_L("Counts per sec=%d"), icountfreq); |
|
38 icountperusec = icountfreq/1000000.0; |
|
39 INFO_PRINTF2(_L("Counts per usec=%f"), icountperusec); |
|
40 |
|
41 TInt err = icontrol.Open(); |
|
42 TESTDIAGNOSTICERROR(err==KErrNone, |
|
43 _L("RFeatureControl::Open failed: error = %d"), err); |
|
44 if(err) { return TestStepResult(); } |
|
45 CleanupClosePushL(icontrol); |
|
46 |
40 |
47 // Get the timeout from the .ini file. The name of the timeout entry |
41 // Get the timeout from the .ini file. The name of the timeout entry |
48 // varies depending on what type of build we have. |
42 // varies depending on what type of build we have. |
49 TBuf<20> timeoutini(_L("Timeout")); |
43 TBuf<20> timeoutini(_L("Timeout")); |
50 #ifdef __WINSCW__ |
44 #ifdef __WINSCW__ |
66 timeoutini.Append(_L("_H6")); |
60 timeoutini.Append(_L("_H6")); |
67 break; |
61 break; |
68 case HAL::EMachineUid_NE1_TB: |
62 case HAL::EMachineUid_NE1_TB: |
69 timeoutini.Append(_L("_NE1")); |
63 timeoutini.Append(_L("_NE1")); |
70 break; |
64 break; |
|
65 case KPlatSimUid: |
|
66 ERR_PRINTF1(_L("Not running performance test in PlatSim")); |
|
67 SkipPerformanceTest = ETrue; //Skip performance test on PlatSim |
|
68 break; |
71 //add any new hardware IDs here |
69 //add any new hardware IDs here |
72 default: |
70 default: |
73 break; |
71 break; |
74 } |
72 } |
75 #endif |
73 #endif |
76 #ifdef _DEBUG |
74 #ifdef _DEBUG |
77 timeoutini.Append(_L("_UDEB")); |
75 timeoutini.Append(_L("_UDEB")); |
78 #else |
76 #else |
79 timeoutini.Append(_L("_UREL")); |
77 timeoutini.Append(_L("_UREL")); |
80 #endif |
78 #endif |
81 |
79 if (!SkipPerformanceTest) |
82 // Get the timeout, which is measured in microseconds. |
80 { |
83 if( !GetIntFromConfig(ConfigSection(), timeoutini, itimeout ) ) |
81 // First find out the granularity of the system clock.. |
84 { |
82 HAL::Get(HALData::EFastCounterFrequency, icountfreq); |
85 ERR_PRINTF2(_L("Can't find '%S' in .ini file"), |
83 INFO_PRINTF2(_L("Counts per sec=%d"), icountfreq); |
86 &timeoutini ); |
84 icountperusec = icountfreq/1000000.0; |
87 CleanupStack::PopAndDestroy(&icontrol); |
85 INFO_PRINTF2(_L("Counts per usec=%f"), icountperusec); |
88 SetTestStepResult(EFail); |
86 TInt err = icontrol.Open(); |
89 return TestStepResult(); |
87 TESTDIAGNOSTICERROR(err==KErrNone, |
90 } |
88 _L("RFeatureControl::Open failed: error = %d"), err); |
|
89 if(err) { return TestStepResult(); } |
|
90 CleanupClosePushL(icontrol); |
|
91 // Get the timeout, which is measured in microseconds. |
|
92 if( !GetIntFromConfig(ConfigSection(), timeoutini, itimeout ) ) |
|
93 { |
|
94 ERR_PRINTF2(_L("Can't find '%S' in .ini file"), |
|
95 &timeoutini ); |
|
96 CleanupStack::PopAndDestroy(&icontrol); |
|
97 SetTestStepResult(EFail); |
|
98 return TestStepResult(); |
|
99 } |
|
100 } |
91 return TestStepResult(); |
101 return TestStepResult(); |
92 } |
102 } |
93 |
103 |
94 TVerdict CCharacteriseBaseStep :: doTestStepPostambleL() |
104 TVerdict CCharacteriseBaseStep :: doTestStepPostambleL() |
95 { |
105 { |
|
106 if (SkipPerformanceTest) |
|
107 { |
|
108 return TestStepResult(); |
|
109 } |
96 CleanupStack::PopAndDestroy(&icontrol); |
110 CleanupStack::PopAndDestroy(&icontrol); |
97 return TestStepResult(); |
111 return TestStepResult(); |
98 } |
112 } |
99 |
113 |
100 CCharacteriseSupportedStep :: CCharacteriseSupportedStep() |
114 CCharacteriseSupportedStep :: CCharacteriseSupportedStep() |
102 SetTestStepName(KCharacteriseSupported); |
116 SetTestStepName(KCharacteriseSupported); |
103 } |
117 } |
104 |
118 |
105 TVerdict CCharacteriseSupportedStep::doTestStepL() |
119 TVerdict CCharacteriseSupportedStep::doTestStepL() |
106 { |
120 { |
|
121 if (SkipPerformanceTest) |
|
122 { |
|
123 return TestStepResult(); |
|
124 } |
107 // The base class 'CCharacteriseBaseStep' has already opened the |
125 // The base class 'CCharacteriseBaseStep' has already opened the |
108 // RFeatureControl object and read in the timeout number. |
126 // RFeatureControl object and read in the timeout number. |
109 |
127 |
110 // Find out how many features we're going to attempt to read, the |
128 // Find out how many features we're going to attempt to read, the |
111 // minimum uid (that we start on) and the number of supported UIDs |
129 // minimum uid (that we start on) and the number of supported UIDs |
169 SetTestStepName(KCharacteriseSupportedArray); |
187 SetTestStepName(KCharacteriseSupportedArray); |
170 } |
188 } |
171 |
189 |
172 TVerdict CCharacteriseSupportedArrayStep::doTestStepL() |
190 TVerdict CCharacteriseSupportedArrayStep::doTestStepL() |
173 { |
191 { |
|
192 if (SkipPerformanceTest) |
|
193 { |
|
194 return TestStepResult(); |
|
195 } |
174 // Find out how many features we're going to attempt to read.. |
196 // Find out how many features we're going to attempt to read.. |
175 TInt nfeats, minuid, expsup; |
197 TInt nfeats, minuid, expsup; |
176 if(!GetIntFromConfig(ConfigSection(), _L("NumFeaturesToRead"), nfeats) || |
198 if(!GetIntFromConfig(ConfigSection(), _L("NumFeaturesToRead"), nfeats) || |
177 !GetIntFromConfig(ConfigSection(), _L("MinFeatureUID"), minuid) || |
199 !GetIntFromConfig(ConfigSection(), _L("MinFeatureUID"), minuid) || |
178 !GetIntFromConfig(ConfigSection(), _L("NumSupported"), expsup)) |
200 !GetIntFromConfig(ConfigSection(), _L("NumSupported"), expsup)) |