|
1 /* |
|
2 * Copyright (c) 1998-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 the License "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 "ttesthandlersettings.h" |
|
20 #include "t_bacline.h" |
|
21 |
|
22 _LIT(KWaitForKeyPressAtEndSwitch, "-w"); |
|
23 _LIT(KOOMSwitch, "-o"); |
|
24 _LIT(KInteractiveSwitch, "-i"); |
|
25 _LIT(KCancelSwitch, "-c"); |
|
26 _LIT(KSkippedSwitch, "-s"); |
|
27 _LIT(KExhaustiveSwitch, "-e"); |
|
28 |
|
29 EXPORT_C CTestHandlerSettings* CTestHandlerSettings::NewLC() |
|
30 { |
|
31 CTestHandlerSettings* self = new(ELeave) CTestHandlerSettings(); |
|
32 CleanupStack::PushL(self); |
|
33 self->ConstructL(); |
|
34 return self; |
|
35 } |
|
36 |
|
37 EXPORT_C CTestHandlerSettings* CTestHandlerSettings::NewL(const CTestHandlerSettings& aOther) |
|
38 { |
|
39 CTestHandlerSettings* self = new(ELeave) CTestHandlerSettings(); |
|
40 self->iWaitForKeyPressAtEnd = aOther.iWaitForKeyPressAtEnd; |
|
41 self->iOOM = aOther.iOOM; |
|
42 self->iCancel = aOther.iCancel; |
|
43 self->iSkip = aOther.iSkip; |
|
44 self->iExhaust = aOther.iExhaust; |
|
45 self->iInt = aOther.iInt; |
|
46 return self; |
|
47 } |
|
48 |
|
49 EXPORT_C CTestHandlerSettings::~CTestHandlerSettings() |
|
50 { |
|
51 } |
|
52 |
|
53 CTestHandlerSettings::CTestHandlerSettings() |
|
54 { |
|
55 iWaitForKeyPressAtEnd = iOOM = iCancel = iSkip = iExhaust = iInt = EFalse; |
|
56 } |
|
57 |
|
58 void CTestHandlerSettings::ConstructL() |
|
59 { |
|
60 CCommandLineArguments* cmdLine = CCommandLineArguments::NewL(); |
|
61 |
|
62 TInt argTotal=cmdLine->Count(); |
|
63 |
|
64 for (TInt loop=0 ; loop < argTotal ; ++loop) |
|
65 { |
|
66 TPtrC arg(cmdLine->Arg(loop)); |
|
67 if (arg==KWaitForKeyPressAtEndSwitch) |
|
68 { |
|
69 iWaitForKeyPressAtEnd = ETrue; |
|
70 } |
|
71 else if (arg==KOOMSwitch) |
|
72 { |
|
73 iOOM = ETrue; |
|
74 } |
|
75 else if (arg==KInteractiveSwitch) |
|
76 { |
|
77 iInt = ETrue; |
|
78 } |
|
79 else if (arg==KCancelSwitch) |
|
80 { |
|
81 iCancel = ETrue; |
|
82 } |
|
83 else if (arg==KSkippedSwitch) |
|
84 { |
|
85 iSkip = ETrue; |
|
86 } |
|
87 else if (arg==KExhaustiveSwitch) |
|
88 { |
|
89 iExhaust = ETrue; |
|
90 } |
|
91 } |
|
92 |
|
93 delete cmdLine; |
|
94 cmdLine = NULL; |
|
95 } |