use of org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart in project linuxtools by eclipse.
the class BasicMassifTest method testNumSnapshots.
@Test
public void testNumSnapshots() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testNumSnapshots");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
MassifSnapshot[] snapshots = view.getSnapshots();
assertEquals(14, snapshots.length);
checkSnapshots(snapshots, 40, 16);
}
use of org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart in project linuxtools by eclipse.
the class ExpandCollapseTest method testExpand.
@Test
public void testExpand() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testDefaults");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
viewer = view.getTreeViewer().getViewer();
contextMenu = viewer.getTree().getMenu();
// Select first snapshot and expand it
MassifHeapTreeNode[] snapshots = (MassifHeapTreeNode[]) viewer.getInput();
MassifHeapTreeNode snapshot = snapshots[0];
TreeSelection selection = new TreeSelection(new TreePath(new Object[] { snapshot }));
viewer.setSelection(selection);
contextMenu.notifyListeners(SWT.Show, null);
contextMenu.getItem(0).notifyListeners(SWT.Selection, null);
checkExpanded(snapshot, true);
}
use of org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart in project linuxtools by eclipse.
the class MultiProcessTest method testExec.
@Test
public void testExec() throws CoreException, URISyntaxException, IOException {
ILaunchConfigurationWorkingCopy config = createConfiguration(proj.getProject()).getWorkingCopy();
config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
config.doSave();
// $NON-NLS-1$
doLaunch(config, "testExec");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
MassifOutput output = view.getOutput();
Integer[] pids = output.getPids();
assertEquals(2, pids.length);
// child not necessarily higher PID than parent
MassifSnapshot[] snapshots1 = output.getSnapshots(pids[0]);
assertTrue(snapshots1.length == 8 || snapshots1.length == 14);
MassifSnapshot[] snapshots2 = output.getSnapshots(pids[1]);
assertTrue(snapshots2.length == 8 || snapshots2.length == 14);
assertNotEquals(snapshots1.length, snapshots2.length);
if (snapshots1.length == 8) {
checkSnapshots(snapshots1, 400, 8);
checkSnapshots(snapshots2, 40, 16);
} else {
checkSnapshots(snapshots1, 40, 16);
checkSnapshots(snapshots2, 400, 8);
}
}
use of org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart in project linuxtools by eclipse.
the class ChartTests method testChartLocationsDialog.
@Test
public void testChartLocationsDialog() throws Exception {
ILaunchConfiguration config = createConfiguration(proj.getProject());
// $NON-NLS-1$
doLaunch(config, "testChartCallback");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
// peak
MassifSnapshot snapshot = view.getSnapshots()[7];
assertTrue(snapshot.isDetailed());
Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
ChartLocationsDialog dialog = new ChartLocationsDialog(parent);
dialog.setInput(snapshot);
dialog.setBlockOnOpen(false);
dialog.open();
MassifHeapTreeNode element = snapshot.getRoot().getChildren()[1];
dialog.getTableViewer().setSelection(new StructuredSelection(element));
dialog.getOkButton().notifyListeners(SWT.Selection, null);
dialog.openEditorForResult();
checkFile(proj.getProject(), element);
checkLine(element);
}
use of org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart in project linuxtools by eclipse.
the class DoubleClickTest method doDoubleClick.
private void doDoubleClick() {
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
MassifTreeViewer treeViewer = view.getTreeViewer();
MassifSnapshot[] snapshots = view.getSnapshots();
// first detailed
node = snapshots[1].getRoot();
TreePath path = new TreePath(new Object[] { node });
while (node.getChildren().length > 0 && !node.hasSourceFile()) {
node = node.getChildren()[0];
path = path.createChildPath(node);
}
assertTrue(node.hasSourceFile());
treeViewer.getViewer().expandToLevel(node, AbstractTreeViewer.ALL_LEVELS);
TreeSelection selection = new TreeSelection(path);
// do double click
IDoubleClickListener listener = treeViewer.getDoubleClickListener();
listener.doubleClick(new DoubleClickEvent(treeViewer.getViewer(), selection));
}
Aggregations