mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-07 16:26:11 +02:00
Fixed the tests to use the CTestPlugin findFileInPlugin
method. This should get the tests working on M6 and M7.
This commit is contained in:
parent
c48ea4de7f
commit
7e32d05829
13 changed files with 111 additions and 96 deletions
|
@ -35,6 +35,7 @@ import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||||
import org.eclipse.cdt.internal.core.search.matching.CSearchPattern;
|
import org.eclipse.cdt.internal.core.search.matching.CSearchPattern;
|
||||||
import org.eclipse.cdt.internal.core.sourcedependency.DependencyQueryJob;
|
import org.eclipse.cdt.internal.core.sourcedependency.DependencyQueryJob;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -667,13 +668,11 @@ import org.eclipse.core.runtime.Platform;
|
||||||
String testCaseName = this.getName();
|
String testCaseName = this.getName();
|
||||||
//Obtain file handle
|
//Obtain file handle
|
||||||
file = testProject.getProject().getFile(fileName);
|
file = testProject.getProject().getFile(fileName);
|
||||||
String pluginRoot = Platform.asLocalURL(
|
|
||||||
Platform.getPlugin("org.eclipse.cdt.core.tests")
|
|
||||||
.getDescriptor().getInstallURL()).getFile();
|
|
||||||
//Create file input stream
|
//Create file input stream
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.create(new FileInputStream(pluginRoot + resourceLocation),
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path(resourceLocation))),
|
||||||
false, monitor);
|
false, monitor);
|
||||||
}
|
}
|
||||||
fileDoc = new IFileDocument(file);
|
fileDoc = new IFileDocument(file);
|
||||||
|
|
|
@ -28,6 +28,7 @@ import org.eclipse.cdt.internal.core.index.impl.IFileDocument;
|
||||||
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
import org.eclipse.cdt.internal.core.search.indexing.IIndexConstants;
|
||||||
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -35,7 +36,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author bgheorgh
|
* @author bgheorgh
|
||||||
|
@ -132,13 +133,11 @@ public class IndexManagerTests extends TestCase {
|
||||||
private IFile importFile(String fileName, String resourceLocation)throws Exception {
|
private IFile importFile(String fileName, String resourceLocation)throws Exception {
|
||||||
//Obtain file handle
|
//Obtain file handle
|
||||||
file = testProject.getProject().getFile(fileName);
|
file = testProject.getProject().getFile(fileName);
|
||||||
String pluginRoot = Platform.asLocalURL(
|
|
||||||
Platform.getPlugin("org.eclipse.cdt.core.tests")
|
|
||||||
.getDescriptor().getInstallURL()).getFile();
|
|
||||||
//Create file input stream
|
//Create file input stream
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.create(new FileInputStream(pluginRoot + resourceLocation),
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path(resourceLocation))),
|
||||||
false, monitor);
|
false, monitor);
|
||||||
}
|
}
|
||||||
fileDoc = new IFileDocument(file);
|
fileDoc = new IFileDocument(file);
|
||||||
|
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.core.model.IBinary;
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.cdt.testplugin.util.ExpectedStrings;
|
import org.eclipse.cdt.testplugin.util.ExpectedStrings;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
|
@ -25,9 +26,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Peter Graves
|
* @author Peter Graves
|
||||||
|
@ -80,47 +78,49 @@ public class ArchiveTests extends TestCase {
|
||||||
* Setup the various files, paths and projects that are needed by the
|
* Setup the various files, paths and projects that are needed by the
|
||||||
* tests
|
* tests
|
||||||
*/
|
*/
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
testProject=CProjectHelper.createCProject("filetest", "none");
|
testProject=CProjectHelper.createCProject("filetest", "none");
|
||||||
if (testProject==null)
|
if (testProject==null)
|
||||||
fail("Unable to create project");
|
fail("Unable to create project");
|
||||||
|
|
||||||
cfile = testProject.getProject().getFile("exetest.c");
|
cfile = testProject.getProject().getFile("exetest.c");
|
||||||
if (!cfile.exists()) {
|
if (!cfile.exists()) {
|
||||||
cfile.create(new FileInputStream(pluginRoot+"resources/exe/main.c"),false, monitor);
|
cfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/main.c"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
|
cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
|
||||||
|
|
||||||
objfile = testProject.getProject().getFile("exetest.o");
|
objfile = testProject.getProject().getFile("exetest.o");
|
||||||
if (!objfile.exists()) {
|
if (!objfile.exists()) {
|
||||||
objfile.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/main.o"),false, monitor);
|
objfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/main.o"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
objpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.o");
|
objpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.o");
|
||||||
|
|
||||||
exefile = testProject.getProject().getFile("test_g");
|
exefile = testProject.getProject().getFile("test_g");
|
||||||
if (!exefile.exists()) {
|
if (!exefile.exists()) {
|
||||||
exefile.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/exe_g"),false, monitor);
|
exefile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/exe_g"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
|
exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
|
||||||
|
|
||||||
archfile = testProject.getProject().getFile("libtestlib_g.a");
|
archfile = testProject.getProject().getFile("libtestlib_g.a");
|
||||||
if (!archfile.exists()) {
|
if (!archfile.exists()) {
|
||||||
archfile.create(new FileInputStream(pluginRoot+"resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
|
archfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/a.g/libtestlib_g.a"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
|
libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
|
||||||
|
|
||||||
libfile = testProject.getProject().getFile("libtestlib_g.so");
|
libfile = testProject.getProject().getFile("libtestlib_g.so");
|
||||||
if (!libfile.exists()) {
|
if (!libfile.exists()) {
|
||||||
libfile.create(new FileInputStream(pluginRoot+"resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
|
libfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/so.g/libtestlib_g.so"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
|
archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.cdt.core.model.IBinary;
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.cdt.testplugin.util.ExpectedStrings;
|
import org.eclipse.cdt.testplugin.util.ExpectedStrings;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
|
@ -26,7 +27,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ public class BinaryTests extends TestCase {
|
||||||
* "com.qnx.tools.ide.cdt.core"
|
* "com.qnx.tools.ide.cdt.core"
|
||||||
*/
|
*/
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
String pluginRoot;
|
|
||||||
/***
|
/***
|
||||||
* The tests assume that they have a working workspace
|
* The tests assume that they have a working workspace
|
||||||
* and workspace root object to use to create projects/files in,
|
* and workspace root object to use to create projects/files in,
|
||||||
|
@ -99,58 +98,64 @@ public class BinaryTests extends TestCase {
|
||||||
if (testProject==null)
|
if (testProject==null)
|
||||||
fail("Unable to create project");
|
fail("Unable to create project");
|
||||||
|
|
||||||
pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
|
|
||||||
cfile = testProject.getProject().getFile("exetest.c");
|
cfile = testProject.getProject().getFile("exetest.c");
|
||||||
if (!cfile.exists()) {
|
if (!cfile.exists()) {
|
||||||
cfile.create(new FileInputStream(pluginRoot+"resources/exe/main.c"),false, monitor);
|
cfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/main.c"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
|
cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
|
||||||
|
|
||||||
objfile = testProject.getProject().getFile("exetest.o");
|
objfile = testProject.getProject().getFile("exetest.o");
|
||||||
if (!objfile.exists()) {
|
if (!objfile.exists()) {
|
||||||
objfile.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/main.o"),false, monitor);
|
objfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/main.o"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
objpath=new Path(workspace.getRoot().getLocation()+"/filetest/exetest.o");
|
objpath=new Path(workspace.getRoot().getLocation()+"/filetest/exetest.o");
|
||||||
|
|
||||||
exefile = testProject.getProject().getFile("test_g");
|
exefile = testProject.getProject().getFile("test_g");
|
||||||
if (!exefile.exists()) {
|
if (!exefile.exists()) {
|
||||||
exefile.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/exe_g"),false, monitor);
|
exefile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/exe_g"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
|
exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
|
||||||
ppcexefile = testProject.getProject().getFile("ppctest_g");
|
ppcexefile = testProject.getProject().getFile("ppctest_g");
|
||||||
if (!ppcexefile.exists()) {
|
if (!ppcexefile.exists()) {
|
||||||
ppcexefile.create(new FileInputStream(pluginRoot+"resources/exe/ppc/be.g/exe_g"),false, monitor);
|
ppcexefile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/ppc/be.g/exe_g"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
ndexe = testProject.getProject().getFile("exetest");
|
ndexe = testProject.getProject().getFile("exetest");
|
||||||
if (!ndexe.exists()) {
|
if (!ndexe.exists()) {
|
||||||
ndexe.create(new FileInputStream(pluginRoot+"resources/exe/x86/o/exe"),false, monitor);
|
ndexe.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o/exe"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bigexe = testProject.getProject().getFile("exebig_g");
|
bigexe = testProject.getProject().getFile("exebig_g");
|
||||||
if (!bigexe.exists()) {
|
if (!bigexe.exists()) {
|
||||||
bigexe.create(new FileInputStream(pluginRoot+"resources/exebig/x86/o.g/exebig_g"),false, monitor);
|
bigexe.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exebig/x86/o.g/exebig_g"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
archfile = testProject.getProject().getFile("libtestlib_g.a");
|
archfile = testProject.getProject().getFile("libtestlib_g.a");
|
||||||
if (!archfile.exists()) {
|
if (!archfile.exists()) {
|
||||||
archfile.create(new FileInputStream(pluginRoot+"resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
|
archfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/a.g/libtestlib_g.a"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
|
libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
|
||||||
|
|
||||||
libfile = testProject.getProject().getFile("libtestlib_g.so");
|
libfile = testProject.getProject().getFile("libtestlib_g.so");
|
||||||
if (!libfile.exists()) {
|
if (!libfile.exists()) {
|
||||||
libfile.create(new FileInputStream(pluginRoot+"resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
|
libfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/so.g/libtestlib_g.so"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
|
archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
|
||||||
|
|
||||||
|
|
|
@ -42,9 +42,11 @@ import org.eclipse.cdt.internal.core.model.MethodTemplate;
|
||||||
import org.eclipse.cdt.internal.core.model.StructureTemplate;
|
import org.eclipse.cdt.internal.core.model.StructureTemplate;
|
||||||
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
|
||||||
public class CModelElementsTests extends TestCase {
|
public class CModelElementsTests extends TestCase {
|
||||||
|
@ -64,14 +66,12 @@ public class CModelElementsTests extends TestCase {
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL())
|
|
||||||
.getFile();
|
|
||||||
|
|
||||||
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
||||||
headerFile = fCProject.getProject().getFile("CModelElementsTest.h");
|
headerFile = fCProject.getProject().getFile("CModelElementsTest.h");
|
||||||
if (!headerFile.exists()) {
|
if (!headerFile.exists()) {
|
||||||
try{
|
try{
|
||||||
FileInputStream fileIn = new FileInputStream(pluginRoot+ "resources/cfiles/CModelElementsTestStart.h");
|
FileInputStream fileIn = new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/cfiles/CModelElementsTestStart.h")));
|
||||||
headerFile.create(fileIn,false, monitor);
|
headerFile.create(fileIn,false, monitor);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -16,6 +16,7 @@ import org.eclipse.cdt.core.CCProjectNature;
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.internal.resources.ResourceException;
|
import org.eclipse.core.internal.resources.ResourceException;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -41,7 +42,6 @@ public class CModelTests extends TestCase {
|
||||||
IWorkspaceRoot root;
|
IWorkspaceRoot root;
|
||||||
IProject project_c, project_cc;
|
IProject project_c, project_cc;
|
||||||
NullProgressMonitor monitor;
|
NullProgressMonitor monitor;
|
||||||
String pluginRoot;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CModelTests.
|
* Constructor for CModelTests.
|
||||||
|
@ -73,7 +73,6 @@ public class CModelTests extends TestCase {
|
||||||
fail("Workspace was not setup");
|
fail("Workspace was not setup");
|
||||||
if (root==null)
|
if (root==null)
|
||||||
fail("Workspace root was not setup");
|
fail("Workspace root was not setup");
|
||||||
pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
desc=workspace.getDescription();
|
desc=workspace.getDescription();
|
||||||
desc.setAutoBuilding(false);
|
desc.setAutoBuilding(false);
|
||||||
workspace.setDescription(desc);
|
workspace.setDescription(desc);
|
||||||
|
@ -144,8 +143,9 @@ public class CModelTests extends TestCase {
|
||||||
|
|
||||||
IFile file = testProject.getProject().getFile("exetest_g");
|
IFile file = testProject.getProject().getFile("exetest_g");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/exe_g"),false, monitor);
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/exe_g"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
/***
|
/***
|
||||||
* file should be a binary, executable, not shared or archive
|
* file should be a binary, executable, not shared or archive
|
||||||
|
@ -160,8 +160,9 @@ public class CModelTests extends TestCase {
|
||||||
|
|
||||||
file = testProject.getProject().getFile("exetest.c");
|
file = testProject.getProject().getFile("exetest.c");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.create(new FileInputStream(pluginRoot+"resources/exe/main.c"),false, monitor);
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/main.c"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
/***
|
/***
|
||||||
* file should be a translation unit
|
* file should be a translation unit
|
||||||
|
@ -175,8 +176,9 @@ public class CModelTests extends TestCase {
|
||||||
|
|
||||||
file = testProject.getProject().getFile("exetest.o");
|
file = testProject.getProject().getFile("exetest.o");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/main.o"),false, monitor);
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/main.o"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
/***
|
/***
|
||||||
* file should be a object file unit
|
* file should be a object file unit
|
||||||
|
@ -190,8 +192,9 @@ public class CModelTests extends TestCase {
|
||||||
|
|
||||||
file = testProject.getProject().getFile("liblibtest_g.so");
|
file = testProject.getProject().getFile("liblibtest_g.so");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.create(new FileInputStream(pluginRoot+"resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/so.g/libtestlib_g.so"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
/***
|
/***
|
||||||
* file should be a sharedlib/binary file
|
* file should be a sharedlib/binary file
|
||||||
|
@ -205,8 +208,9 @@ public class CModelTests extends TestCase {
|
||||||
|
|
||||||
file = testProject.getProject().getFile("liblibtest_g.a");
|
file = testProject.getProject().getFile("liblibtest_g.a");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.create(new FileInputStream(pluginRoot+"resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/a.g/libtestlib_g.a"))),
|
||||||
|
false, monitor);
|
||||||
} else {
|
} else {
|
||||||
fail("Does not exist?");
|
fail("Does not exist?");
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,11 +33,12 @@ import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||||
import org.eclipse.cdt.internal.core.model.CModelManager;
|
import org.eclipse.cdt.internal.core.model.CModelManager;
|
||||||
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.cdt.testplugin.TestPluginLauncher;
|
import org.eclipse.cdt.testplugin.TestPluginLauncher;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for testing the C Element Delta Builder.
|
* Class for testing the C Element Delta Builder.
|
||||||
|
@ -66,14 +67,14 @@ public class ElementDeltaTests extends TestCase implements IElementChangedListen
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
|
|
||||||
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
||||||
//Path filePath = new Path(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ fCProject.getPath().toString()+ "/WorkingCopyTest.h");
|
//Path filePath = new Path(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ fCProject.getPath().toString()+ "/WorkingCopyTest.h");
|
||||||
headerFile = fCProject.getProject().getFile("WorkingCopyTest.h");
|
headerFile = fCProject.getProject().getFile("WorkingCopyTest.h");
|
||||||
if (!headerFile.exists()) {
|
if (!headerFile.exists()) {
|
||||||
try{
|
try{
|
||||||
FileInputStream fileIn = new FileInputStream(pluginRoot+ "resources/cfiles/WorkingCopyTestStart.h");
|
FileInputStream fileIn = new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/cfiles/WorkingCopyTestStart.h")));
|
||||||
headerFile.create(fileIn,false, monitor);
|
headerFile.create(fileIn,false, monitor);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -14,10 +14,11 @@ import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author bnicolle
|
* @author bnicolle
|
||||||
|
@ -56,14 +57,12 @@ public abstract class IntegratedCModelTest extends TestCase {
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
|
|
||||||
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
||||||
|
|
||||||
sourceFile = fCProject.getProject().getFile( getSourcefileResource() );
|
sourceFile = fCProject.getProject().getFile( getSourcefileResource() );
|
||||||
if (!sourceFile.exists()) {
|
if (!sourceFile.exists()) {
|
||||||
try{
|
try{
|
||||||
FileInputStream fileIn = new FileInputStream(pluginRoot+ getSourcefileSubdir() + getSourcefileResource() );
|
FileInputStream fileIn = new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path(getSourcefileSubdir() + getSourcefileResource())));
|
||||||
sourceFile.create(fileIn,false, monitor);
|
sourceFile.create(fileIn,false, monitor);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -17,6 +17,7 @@ import junit.framework.TestCase;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICProject;
|
import org.eclipse.cdt.core.model.ICProject;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.internal.resources.ResourceException;
|
import org.eclipse.core.internal.resources.ResourceException;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IWorkspace;
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
|
@ -80,7 +81,6 @@ public class TranslationUnitBaseTest extends TestCase
|
||||||
* so we need to get them setup first.
|
* so we need to get them setup first.
|
||||||
*/
|
*/
|
||||||
IWorkspaceDescription desc;
|
IWorkspaceDescription desc;
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
workspace= ResourcesPlugin.getWorkspace();
|
workspace= ResourcesPlugin.getWorkspace();
|
||||||
root= workspace.getRoot();
|
root= workspace.getRoot();
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
|
@ -104,36 +104,41 @@ public class TranslationUnitBaseTest extends TestCase
|
||||||
|
|
||||||
cfile = testProject.getProject().getFile("exetest.c");
|
cfile = testProject.getProject().getFile("exetest.c");
|
||||||
if (!cfile.exists()) {
|
if (!cfile.exists()) {
|
||||||
cfile.create(new FileInputStream(pluginRoot+"resources/cfiles/TranslationUnits.c"),false, monitor);
|
cfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/cfiles/TranslationUnits.c"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
|
cpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.c");
|
||||||
|
|
||||||
objfile = testProject.getProject().getFile("exetest.o");
|
objfile = testProject.getProject().getFile("exetest.o");
|
||||||
if (!objfile.exists()) {
|
if (!objfile.exists()) {
|
||||||
objfile.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/main.o"),false, monitor);
|
objfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/main.o"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
objpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.o");
|
objpath=new Path(workspace.getRoot().getLocation()+"/filetest/main.o");
|
||||||
|
|
||||||
exefile = testProject.getProject().getFile("test_g");
|
exefile = testProject.getProject().getFile("test_g");
|
||||||
if (!exefile.exists()) {
|
if (!exefile.exists()) {
|
||||||
exefile.create(new FileInputStream(pluginRoot+"resources/exe/x86/o.g/exe_g"),false, monitor);
|
exefile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/exe/x86/o.g/exe_g"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
|
exepath=new Path(workspace.getRoot().getLocation()+"/filetest/exe_g");
|
||||||
|
|
||||||
archfile = testProject.getProject().getFile("libtestlib_g.a");
|
archfile = testProject.getProject().getFile("libtestlib_g.a");
|
||||||
if (!archfile.exists()) {
|
if (!archfile.exists()) {
|
||||||
archfile.create(new FileInputStream(pluginRoot+"resources/testlib/x86/a.g/libtestlib_g.a"),false, monitor);
|
archfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/a.g/libtestlib_g.a"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
|
libpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.so");
|
||||||
|
|
||||||
libfile = testProject.getProject().getFile("libtestlib_g.so");
|
libfile = testProject.getProject().getFile("libtestlib_g.so");
|
||||||
if (!libfile.exists()) {
|
if (!libfile.exists()) {
|
||||||
libfile.create(new FileInputStream(pluginRoot+"resources/testlib/x86/so.g/libtestlib_g.so"),false, monitor);
|
libfile.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/testlib/x86/so.g/libtestlib_g.so"))),
|
||||||
|
false, monitor);
|
||||||
}
|
}
|
||||||
archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
|
archpath=new Path(workspace.getRoot().getLocation()+"/filetest/libtestlib_g.a");
|
||||||
|
|
||||||
|
|
|
@ -24,11 +24,12 @@ import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||||
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
import org.eclipse.cdt.internal.core.model.TranslationUnit;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.cdt.testplugin.TestPluginLauncher;
|
import org.eclipse.cdt.testplugin.TestPluginLauncher;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains unit test cases for Working Copies. Run using JUnit Plugin Test
|
* Contains unit test cases for Working Copies. Run using JUnit Plugin Test
|
||||||
|
@ -56,14 +57,14 @@ public class WorkingCopyTests extends TestCase {
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
monitor = new NullProgressMonitor();
|
monitor = new NullProgressMonitor();
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
|
|
||||||
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
fCProject= CProjectHelper.createCCProject("TestProject1", "bin");
|
||||||
//Path filePath = new Path(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ fCProject.getPath().toString()+ "/WorkingCopyTest.h");
|
//Path filePath = new Path(ResourcesPlugin.getWorkspace().getRoot().getLocation().toString()+ fCProject.getPath().toString()+ "/WorkingCopyTest.h");
|
||||||
headerFile = fCProject.getProject().getFile("WorkingCopyTest.h");
|
headerFile = fCProject.getProject().getFile("WorkingCopyTest.h");
|
||||||
if (!headerFile.exists()) {
|
if (!headerFile.exists()) {
|
||||||
try{
|
try{
|
||||||
FileInputStream fileIn = new FileInputStream(pluginRoot+ "resources/cfiles/WorkingCopyTestStart.h");
|
FileInputStream fileIn = new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path("resources/cfiles/WorkingCopyTestStart.h")));
|
||||||
headerFile.create(fileIn,false, monitor);
|
headerFile.create(fileIn,false, monitor);
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.cdt.core.search.ICSearchResultCollector;
|
||||||
import org.eclipse.cdt.core.search.ICSearchScope;
|
import org.eclipse.cdt.core.search.ICSearchScope;
|
||||||
import org.eclipse.cdt.core.search.SearchEngine;
|
import org.eclipse.cdt.core.search.SearchEngine;
|
||||||
import org.eclipse.cdt.testplugin.CProjectHelper;
|
import org.eclipse.cdt.testplugin.CProjectHelper;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.cdt.testplugin.FileManager;
|
import org.eclipse.cdt.testplugin.FileManager;
|
||||||
import org.eclipse.core.internal.resources.ResourceException;
|
import org.eclipse.core.internal.resources.ResourceException;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
|
@ -34,7 +35,7 @@ import org.eclipse.core.resources.IWorkspace;
|
||||||
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.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author aniefer
|
* @author aniefer
|
||||||
|
@ -109,11 +110,12 @@ public class BaseSearchTest extends TestCase implements ICSearchConstants {
|
||||||
private void importFile(String fileName, String resourceLocation) throws Exception{
|
private void importFile(String fileName, String resourceLocation) throws Exception{
|
||||||
//Obtain file handle
|
//Obtain file handle
|
||||||
file = testProject.getProject().getFile(fileName);
|
file = testProject.getProject().getFile(fileName);
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
|
||||||
//Create file input stream
|
//Create file input stream
|
||||||
|
|
||||||
if (!file.exists()){
|
if (!file.exists()){
|
||||||
file.create(new FileInputStream(pluginRoot + resourceLocation),false,monitor);
|
file.create(new FileInputStream(
|
||||||
|
CTestPlugin.getDefault().getFileInPlugin(new Path(resourceLocation))),
|
||||||
|
false,monitor);
|
||||||
fileManager.addFile(file);
|
fileManager.addFile(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,9 @@ import org.eclipse.cdt.internal.core.search.matching.FieldDeclarationPattern;
|
||||||
import org.eclipse.cdt.internal.core.search.matching.MatchLocator;
|
import org.eclipse.cdt.internal.core.search.matching.MatchLocator;
|
||||||
import org.eclipse.cdt.internal.core.search.matching.NamespaceDeclarationPattern;
|
import org.eclipse.cdt.internal.core.search.matching.NamespaceDeclarationPattern;
|
||||||
import org.eclipse.cdt.internal.core.search.matching.OrPattern;
|
import org.eclipse.cdt.internal.core.search.matching.OrPattern;
|
||||||
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -318,8 +320,7 @@ public class OtherPatternTests extends BaseSearchTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNoResourceSearching() throws Exception {
|
public void testNoResourceSearching() throws Exception {
|
||||||
String pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
String path = CTestPlugin.getDefault().getFileInPlugin(new Path("resources/search/include.h")).getAbsolutePath();
|
||||||
String path = pluginRoot + "resources/search/include.h";
|
|
||||||
|
|
||||||
ICSearchPattern pattern = SearchEngine.createSearchPattern( "Head", CLASS, REFERENCES, true );
|
ICSearchPattern pattern = SearchEngine.createSearchPattern( "Head", CLASS, REFERENCES, true );
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ import org.eclipse.cdt.core.parser.ParserFactory;
|
||||||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||||
import org.eclipse.cdt.core.parser.ParserMode;
|
import org.eclipse.cdt.core.parser.ParserMode;
|
||||||
import org.eclipse.cdt.core.parser.ScannerInfo;
|
import org.eclipse.cdt.core.parser.ScannerInfo;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.cdt.testplugin.CTestPlugin;
|
||||||
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
|
@ -32,7 +33,6 @@ import org.eclipse.core.runtime.Platform;
|
||||||
*/
|
*/
|
||||||
public class ParseTestOnSearchFiles extends TestCase
|
public class ParseTestOnSearchFiles extends TestCase
|
||||||
{
|
{
|
||||||
private String pluginRoot;
|
|
||||||
private FileInputStream fileIn;
|
private FileInputStream fileIn;
|
||||||
private String name;
|
private String name;
|
||||||
/**
|
/**
|
||||||
|
@ -51,9 +51,8 @@ public class ParseTestOnSearchFiles extends TestCase
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
pluginRoot = Platform.asLocalURL(Platform.getPlugin("org.eclipse.cdt.core.tests").getDescriptor().getInstallURL()).getFile();
|
name = "resources/search/classDecl.cpp";
|
||||||
name = pluginRoot+ "resources/search/classDecl.cpp";
|
fileIn = new FileInputStream(CTestPlugin.getDefault().getFileInPlugin(new Path(name)));
|
||||||
fileIn = new FileInputStream(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testParseOfAndrewsFile() throws Exception
|
public void testParseOfAndrewsFile() throws Exception
|
||||||
|
|
Loading…
Add table
Reference in a new issue