author | stechong |
Fri, 11 Jun 2010 12:09:52 -0500 | |
branch | C3_BUILDER_WORK |
changeset 1462 | b38491fd06da |
parent 1444 | 4f7d895e3e16 |
child 1479 | a654857ddb87 |
permissions | -rw-r--r-- |
126 | 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 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 |
*/ |
|
125 | 17 |
package com.nokia.carbide.cdt.builder.test.errorParsers; |
18 |
||
19 |
import java.io.IOException; |
|
20 |
import java.util.ArrayList; |
|
21 |
import java.util.List; |
|
22 |
||
632
4a8b1092f0a4
Fix some error parser unit tests. A trailing colon was being included in several source files.
Ed Swartz <ed.swartz@nokia.com>
parents:
126
diff
changeset
|
23 |
import junit.framework.TestCase; |
4a8b1092f0a4
Fix some error parser unit tests. A trailing colon was being included in several source files.
Ed Swartz <ed.swartz@nokia.com>
parents:
126
diff
changeset
|
24 |
|
125 | 25 |
import org.eclipse.core.resources.IProject; |
26 |
import org.eclipse.core.runtime.NullProgressMonitor; |
|
27 |
||
28 |
import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; |
|
29 |
import com.nokia.carbide.cdt.builder.builder.CarbideCPPBuilder; |
|
30 |
import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; |
|
31 |
import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo; |
|
32 |
import com.nokia.carbide.cdt.builder.test.TestPlugin; |
|
33 |
import com.nokia.carbide.cpp.project.core.ProjectCorePlugin; |
|
34 |
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
|
1444
4f7d895e3e16
Fixed errors in unit tests due to ISymbianSDK refactoring, plus other updates to SDK core and UI plugins.
stechong
parents:
632
diff
changeset
|
35 |
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID; |
125 | 36 |
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
37 |
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; |
|
38 |
import com.nokia.cpp.internal.api.utils.core.FileUtils; |
|
39 |
||
632
4a8b1092f0a4
Fix some error parser unit tests. A trailing colon was being included in several source files.
Ed Swartz <ed.swartz@nokia.com>
parents:
126
diff
changeset
|
40 |
public class TestMakeErrorParser extends TestCase { |
125 | 41 |
|
42 |
public TestMakeErrorParser(String name) { |
|
43 |
super(name); |
|
44 |
// TODO Auto-generated constructor stub |
|
45 |
} |
|
46 |
||
47 |
CarbideErrorParserTestHarness harness; |
|
48 |
private IProject project; |
|
49 |
||
50 |
private static final String PROJECT_NAME = "TestGcceErrorParser"; |
|
51 |
private static final String PROJECT_PATH = "group/bld.inf"; |
|
52 |
||
53 |
protected void setUp() throws Exception { |
|
54 |
super.setUp(); |
|
55 |
project = ProjectCorePlugin.createProject(PROJECT_NAME, null); |
|
56 |
List<ISymbianBuildContext> contextList = new ArrayList<ISymbianBuildContext>(); |
|
57 |
||
58 |
// You need to set the proper default configuration so the correct set of error parsers is called |
|
59 |
List<ISymbianSDK> sdkList = SDKCorePlugin.getSDKManager().getSDKList(); |
|
60 |
for (ISymbianSDK currSDK : sdkList){ |
|
1462 | 61 |
List<ISymbianBuildContext> contexts = currSDK.getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER).getAllBuildConfigurations(); |
125 | 62 |
for (ISymbianBuildContext context : contexts) { |
63 |
if (context.getPlatformString().equals(ISymbianBuildContext.EMULATOR_PLATFORM)) { |
|
64 |
contextList.add(context); |
|
65 |
break; |
|
66 |
} |
|
67 |
} |
|
68 |
if (contextList.size() > 0) { |
|
69 |
break; |
|
70 |
} |
|
71 |
} |
|
72 |
||
73 |
assertTrue(contextList.size() > 0); // if this fail, you don't have any SDK installed supporting GCCE |
|
74 |
||
75 |
ProjectCorePlugin.postProjectCreatedActions(project, PROJECT_PATH, |
|
76 |
contextList, new ArrayList<String>(), |
|
77 |
"Debug MMP", null, new NullProgressMonitor()); |
|
78 |
||
79 |
ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project); |
|
80 |
ICarbideBuildConfiguration buildConfig = cpi.getDefaultConfiguration(); |
|
81 |
harness = new CarbideErrorParserTestHarness(project, |
|
82 |
new NullProgressMonitor(), |
|
83 |
CarbideCPPBuilder.getParserIdArray(buildConfig.getErrorParserId()), |
|
84 |
cpi.getINFWorkingDirectory()); |
|
85 |
} |
|
86 |
||
87 |
protected void tearDown() throws Exception { |
|
88 |
project.delete(true, null); |
|
89 |
super.tearDown(); |
|
90 |
} |
|
91 |
||
92 |
/** |
|
93 |
* Regress Bugzilla issues by entries |
|
94 |
*/ |
|
95 |
public void testBugzillaRegression() { |
|
96 |
final String reportID[] = {"3201", "3134", "3490", "6415"}; |
|
97 |
//argument 1 is console output you get from the tool |
|
98 |
//argument 2 is control XML with the marker data |
|
99 |
try { |
|
100 |
for (int i = 0; i < reportID.length; i++) { |
|
101 |
harness.parseStringAndTestAgainstXML(FileUtils.pluginRelativeFile(TestPlugin.getDefault(), "data/errorpatterns/bugzilla/" + reportID[i] +".winscw.input.txt"), |
|
102 |
FileUtils.pluginRelativeFile(TestPlugin.getDefault(), "data/errorpatterns/bugzilla/" + reportID[i] +".winscw.regression.xml")); |
|
103 |
} |
|
104 |
} catch (IOException e) { |
|
105 |
fail(); |
|
106 |
} |
|
107 |
} |
|
108 |
||
109 |
} |