286
|
1 |
// Copyright (c) 2010 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 |
// e32test\misc\testexclusions.h
|
|
15 |
// Gets the test exclusion property which is set by reading a file provided by base port and
|
|
16 |
// based on this property some tests can be excluded
|
|
17 |
//
|
|
18 |
//
|
|
19 |
|
|
20 |
#ifndef __TESTEXCLUSIONS_H__
|
|
21 |
#define __TESTEXCLUSIONS_H__
|
|
22 |
|
|
23 |
#include <e32svr.h>
|
|
24 |
#include <u32hal.h>
|
|
25 |
#include <e32property.h>
|
|
26 |
#include <e32uid.h>
|
|
27 |
#include <f32file.h>
|
|
28 |
|
|
29 |
_LIT(KLitPlatformTestExclusionFile, "Z:\\sys\\data\\platformtestexclusion.txt");
|
|
30 |
|
|
31 |
// Bit masks to disable different tests
|
|
32 |
|
|
33 |
// To disable invoking PowerController::PowerDown
|
|
34 |
const TUint KDisableControllerShutdown = 0x1;
|
300
|
35 |
// To disable test t_entropysources on platforms/configurations known to have no entropy source
|
|
36 |
const TUint KDisableEntropySourceCheck = 0x2;
|
286
|
37 |
|
|
38 |
TInt GetExclusionFromFile(TUint& aTestExclusion)
|
|
39 |
{
|
|
40 |
RFs theFs;
|
|
41 |
TInt r = KErrNone;
|
|
42 |
r = theFs.Connect();
|
|
43 |
if (r != KErrNone)
|
|
44 |
return r;
|
|
45 |
|
|
46 |
RFile file;
|
|
47 |
TFileName filename(KLitPlatformTestExclusionFile);
|
|
48 |
r = file.Open(theFs, filename, EFileRead);
|
|
49 |
if (r == KErrNone)
|
|
50 |
{
|
|
51 |
TBuf8<8> data;
|
|
52 |
file.Read(data);
|
|
53 |
TLex8 lexData(data);
|
|
54 |
r = lexData.Val(aTestExclusion, EHex);
|
|
55 |
file.Close();
|
|
56 |
}
|
|
57 |
|
|
58 |
theFs.Close();
|
|
59 |
return r;
|
|
60 |
}
|
|
61 |
|
|
62 |
|
|
63 |
TInt GetTestExclusionSettings(TInt& aTestExclusion)
|
|
64 |
{
|
|
65 |
TInt r = RProperty::Get(KUidSystemCategory, KPlatformTestExclusionKey, aTestExclusion);
|
|
66 |
if (r != KErrNotFound)
|
|
67 |
return r;
|
|
68 |
|
|
69 |
_LIT_SECURITY_POLICY_PASS(KTestPropPolicy);
|
|
70 |
r = RProperty::Define(KUidSystemCategory, KPlatformTestExclusionKey, RProperty::EInt, KTestPropPolicy, KTestPropPolicy);
|
|
71 |
if (r != KErrNone)
|
|
72 |
return r;
|
|
73 |
|
|
74 |
|
|
75 |
TUint testExclusion = 0;
|
|
76 |
r = GetExclusionFromFile(testExclusion);
|
|
77 |
if ((r != KErrNotFound) && (r != KErrNone)) // All platforms need not have test exclusions file defined
|
|
78 |
return r;
|
|
79 |
|
|
80 |
aTestExclusion = testExclusion;
|
|
81 |
r = RProperty::Set(KUidSystemCategory, KPlatformTestExclusionKey, testExclusion);
|
|
82 |
return r;
|
|
83 |
}
|
|
84 |
|
|
85 |
#endif // __TESTEXCLUSIONS_H__
|
|
86 |
|