|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "omxxmltestrunner.h" |
|
20 #include <test/testexecutelogger.h> |
|
21 |
|
22 COmxXmlTestRunner* COmxXmlTestRunner::NewL(CTestExecuteLogger& aLogger) |
|
23 { |
|
24 COmxXmlTestRunner* self = new(ELeave) COmxXmlTestRunner(aLogger); |
|
25 CleanupStack::PushL(self); |
|
26 self->ConstructL(); |
|
27 CleanupStack::Pop(self); |
|
28 return self; |
|
29 } |
|
30 |
|
31 COmxXmlTestRunner::COmxXmlTestRunner(CTestExecuteLogger& aLogger): |
|
32 iTestExecuteLogger(aLogger) |
|
33 { |
|
34 } |
|
35 |
|
36 void COmxXmlTestRunner::ConstructL() |
|
37 { |
|
38 iScript = COmxXmlScript::NewL(*this); |
|
39 } |
|
40 |
|
41 COmxXmlTestRunner::~COmxXmlTestRunner() |
|
42 { |
|
43 delete iFilename; |
|
44 delete iScript; |
|
45 } |
|
46 |
|
47 void COmxXmlTestRunner::SetFilenameL(const TDesC& aFilename) |
|
48 { |
|
49 iFilename = aFilename.AllocL(); |
|
50 } |
|
51 |
|
52 void COmxXmlTestRunner::RunTestL(const TDesC& aSectionName) |
|
53 { |
|
54 // TODO check for memory leaks |
|
55 // TODO how to fail test block without causing E32USER-CBase 47 panic |
|
56 iScript->RunScriptL(*iFilename, aSectionName); |
|
57 } |
|
58 |
|
59 void COmxXmlTestRunner::Log(const TText8* aFile, TInt aLine, TOmxScriptSeverity aSeverity, const TDes& aMessage) |
|
60 { |
|
61 // TEF Severity values are not the same as OMX Script |
|
62 TLogSeverity tefSeverity; |
|
63 switch(aSeverity) |
|
64 { |
|
65 case EOmxScriptSevErr: |
|
66 tefSeverity = ESevrErr; |
|
67 break; |
|
68 case EOmxScriptSevWarn: |
|
69 tefSeverity = ESevrWarn; |
|
70 break; |
|
71 case EOmxScriptSevInfo: |
|
72 tefSeverity = ESevrInfo; |
|
73 break; |
|
74 default: |
|
75 tefSeverity = ESevrAll; |
|
76 } |
|
77 |
|
78 iTestExecuteLogger.LogExtra(aFile, aLine, tefSeverity, aMessage); |
|
79 } |