mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
update test to Eclipse 3.0
This commit is contained in:
parent
1662c1895f
commit
6b222b30ad
5 changed files with 637 additions and 631 deletions
debug/org.eclipse.cdt.debug.ui.tests
core/org/eclipse/cdt/debug/core/tests
resources
src/org/eclipse/cdt/debug/testplugin
File diff suppressed because it is too large
Load diff
|
@ -26,6 +26,7 @@ import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
|
@ -78,9 +79,8 @@ public class DebugTests extends TestCase {
|
||||||
/***
|
/***
|
||||||
* Create a new project and import the test source.
|
* Create a new project and import the test source.
|
||||||
*/
|
*/
|
||||||
String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.debug.ui.tests").find(new Path("/")).getFile();
|
IPath importFile = new Path("resources/debugTest.zip");
|
||||||
pluginRoot=pluginRoot+"resources/debugTest.zip";
|
testProject=CProjectHelper.createCProjectWithImport("filetest", importFile);
|
||||||
testProject=CProjectHelper.createCProjectWithImport("filetest", pluginRoot);
|
|
||||||
if (testProject==null)
|
if (testProject==null)
|
||||||
fail("Unable to create project");
|
fail("Unable to create project");
|
||||||
/* Build the test project.. */
|
/* Build the test project.. */
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
|
@ -79,9 +80,8 @@ public class LocationTests extends TestCase {
|
||||||
/***
|
/***
|
||||||
* Create a new project and import the test source.
|
* Create a new project and import the test source.
|
||||||
*/
|
*/
|
||||||
String pluginRoot=org.eclipse.core.runtime.Platform.getPlugin("org.eclipse.cdt.debug.ui.tests").find(new Path("/")).getFile();
|
IPath importFile = new Path("resources/debugTest.zip");
|
||||||
pluginRoot=pluginRoot+"resources/debugTest.zip";
|
testProject=CProjectHelper.createCProjectWithImport("filetest", importFile);
|
||||||
testProject=CProjectHelper.createCProjectWithImport("filetest", pluginRoot);
|
|
||||||
if (testProject==null)
|
if (testProject==null)
|
||||||
fail("Unable to create project");
|
fail("Unable to create project");
|
||||||
/* Build the test project.. */
|
/* Build the test project.. */
|
||||||
|
|
Binary file not shown.
|
@ -1,5 +1,6 @@
|
||||||
package org.eclipse.cdt.debug.testplugin;
|
package org.eclipse.cdt.debug.testplugin;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
|
@ -35,7 +36,7 @@ public class CProjectHelper {
|
||||||
/**
|
/**
|
||||||
* Creates a ICProject.
|
* Creates a ICProject.
|
||||||
*/
|
*/
|
||||||
public static ICProject createCProjectWithImport(String projectName, String zipFile) throws CoreException, InvocationTargetException, IOException {
|
public static ICProject createCProjectWithImport(String projectName, IPath zipFile) throws CoreException, InvocationTargetException, IOException {
|
||||||
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
|
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
|
||||||
IProject project= root.getProject(projectName);
|
IProject project= root.getProject(projectName);
|
||||||
if (!project.exists()) {
|
if (!project.exists()) {
|
||||||
|
@ -47,7 +48,8 @@ public class CProjectHelper {
|
||||||
if (!project.isOpen()) {
|
if (!project.isOpen()) {
|
||||||
project.open(null);
|
project.open(null);
|
||||||
}
|
}
|
||||||
importFilesFromZip(new ZipFile(zipFile),project.getFullPath(),null);
|
File zip = CTestPlugin.getDefault().getFileInPlugin(zipFile);
|
||||||
|
importFilesFromZip(new ZipFile(zip),project.getFullPath(),null);
|
||||||
|
|
||||||
if (!project.hasNature(CProjectNature.C_NATURE_ID)) {
|
if (!project.hasNature(CProjectNature.C_NATURE_ID)) {
|
||||||
addNatureToProject(project, CProjectNature.C_NATURE_ID, null);
|
addNatureToProject(project, CProjectNature.C_NATURE_ID, null);
|
||||||
|
|
Loading…
Add table
Reference in a new issue