use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile in project linuxtools by eclipse.
the class CModelLabelsTest method testNestedMethodLabel.
@Test
public void testNestedMethodLabel() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testNestedMethodLabel");
CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
CachegrindOutput output = view.getOutputs()[0];
// $NON-NLS-1$
CachegrindFile file = getFileByName(output, "cpptest.cpp");
// $NON-NLS-1$
CachegrindFunction func = getFunctionByName(file, "A::B::e()");
assertTrue(func.getModel() instanceof IMethod);
checkLabelProvider(func, file);
}
use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile in project linuxtools by eclipse.
the class DoubleClickTest method checkFile.
private IEditorPart checkFile(CachegrindFile file) {
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
IEditorInput input = editor.getEditorInput();
IFileEditorInput fileInput = (IFileEditorInput) input;
IResource expectedResource = proj.getProject().findMember(file.getName());
File expectedFile = expectedResource.getLocation().toFile();
File actualFile = fileInput.getFile().getLocation().toFile();
assertEquals(expectedFile, actualFile);
return editor;
}
use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile in project linuxtools by eclipse.
the class DoubleClickTest method testDoubleClickFile.
@Test
public void testDoubleClickFile() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testDoubleClickFile");
CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
CachegrindOutput output = view.getOutputs()[0];
// $NON-NLS-1$
CachegrindFile file = getFileByName(output, "cpptest.cpp");
TreePath path = new TreePath(new Object[] { output, file });
doDoubleClick(path);
checkFile(file);
}
use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile in project linuxtools by eclipse.
the class MultiProcessTest method testNumFunctions.
@Test
public void testNumFunctions() throws Exception {
ILaunchConfigurationWorkingCopy config = createConfiguration(proj.getProject()).getWorkingCopy();
config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
config.doSave();
// $NON-NLS-1$
doLaunch(config, "testExec");
CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
int pidIx = 0;
CachegrindOutput output = view.getOutputs()[pidIx];
// $NON-NLS-1$
CachegrindFile file = getFileByName(output, "cpptest.cpp");
if (file == null) {
pidIx = 1;
output = view.getOutputs()[pidIx];
// $NON-NLS-1$
file = getFileByName(output, "cpptest.cpp");
}
assertNotNull(file);
assertEquals(8, file.getFunctions().length);
// test other pid
pidIx = (pidIx + 1) % 2;
output = view.getOutputs()[pidIx];
// $NON-NLS-1$
file = getFileByName(output, "parent.cpp");
assertNotNull(file);
assertEquals(6, file.getFunctions().length);
}
use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile in project linuxtools by eclipse.
the class MultiProcessTest method testFileNames.
@Test
public void testFileNames() throws Exception {
ILaunchConfigurationWorkingCopy config = createConfiguration(proj.getProject()).getWorkingCopy();
config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
config.doSave();
// $NON-NLS-1$
doLaunch(config, "testExec");
CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
int pidIx = 0;
CachegrindOutput output = view.getOutputs()[pidIx];
// $NON-NLS-1$
CachegrindFile file = getFileByName(output, "cpptest.cpp");
if (file == null) {
pidIx = 1;
output = view.getOutputs()[pidIx];
// $NON-NLS-1$
file = getFileByName(output, "cpptest.cpp");
}
assertNotNull(file);
// $NON-NLS-1$
file = getFileByName(output, "cpptest.h");
assertNotNull(file);
// test other pid
pidIx = (pidIx + 1) % 2;
output = view.getOutputs()[pidIx];
// $NON-NLS-1$
file = getFileByName(output, "parent.cpp");
assertNotNull(file);
}
Aggregations