use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput 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.CachegrindOutput 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.CachegrindOutput in project linuxtools by eclipse.
the class ExpandCollapseTest method testCollapse.
@Test
public void testCollapse() throws Exception {
// Expand the element first
testExpand();
// Then collapse it
CachegrindOutput[] outputs = (CachegrindOutput[]) viewer.getInput();
CachegrindOutput output = outputs[0];
TreeSelection selection = new TreeSelection(new TreePath(new Object[] { output }));
viewer.setSelection(selection);
contextMenu.notifyListeners(SWT.Show, null);
contextMenu.getItem(1).notifyListeners(SWT.Selection, null);
checkExpanded(output, false);
}
use of org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput 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.CachegrindOutput 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