Search in sources :

Example 1 with CachegrindViewPart

use of org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart in project linuxtools by eclipse.

the class CModelLabelsTest method checkLabelProvider.

private static void checkLabelProvider(CachegrindFunction func, CachegrindFile file) {
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    TreeViewer viewer = view.getViewer();
    TreePath path = new TreePath(new Object[] { view.getOutputs()[0], file, func });
    checkLabelProvider(viewer, path, func);
}
Also used : TreePath(org.eclipse.jface.viewers.TreePath) AbstractTreeViewer(org.eclipse.jface.viewers.AbstractTreeViewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart)

Example 2 with CachegrindViewPart

use of org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart 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);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) CachegrindOutput(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput) CachegrindFile(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile) CachegrindFunction(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFunction) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) IMethod(org.eclipse.cdt.core.model.IMethod) Test(org.junit.Test)

Example 3 with CachegrindViewPart

use of org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart 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);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) TreePath(org.eclipse.jface.viewers.TreePath) CachegrindOutput(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput) CachegrindFile(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Example 4 with CachegrindViewPart

use of org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart in project linuxtools by eclipse.

the class DoubleClickTest method doDoubleClick.

private static void doDoubleClick(TreePath path) {
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    TreeViewer treeViewer = view.getViewer();
    ICachegrindElement element = (ICachegrindElement) path.getLastSegment();
    treeViewer.expandToLevel(element, AbstractTreeViewer.ALL_LEVELS);
    TreeSelection selection = new TreeSelection(path);
    IDoubleClickListener listener = view.getDoubleClickListener();
    listener.doubleClick(new DoubleClickEvent(treeViewer, selection));
}
Also used : ICachegrindElement(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.ICachegrindElement) AbstractTreeViewer(org.eclipse.jface.viewers.AbstractTreeViewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) TreeSelection(org.eclipse.jface.viewers.TreeSelection) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart)

Example 5 with CachegrindViewPart

use of org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart in project linuxtools by eclipse.

the class MultiProcessTest method testNoExec.

@Test
public void testNoExec() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testNoExec");
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    assertEquals(1, view.getOutputs().length);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Aggregations

CachegrindViewPart (org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart)19 Test (org.junit.Test)16 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)13 CachegrindOutput (org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput)13 CachegrindFile (org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile)12 TreePath (org.eclipse.jface.viewers.TreePath)6 CachegrindFunction (org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFunction)5 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)3 AbstractTreeViewer (org.eclipse.jface.viewers.AbstractTreeViewer)3 TreeViewer (org.eclipse.jface.viewers.TreeViewer)3 IMethod (org.eclipse.cdt.core.model.IMethod)2 ITranslationUnit (org.eclipse.cdt.core.model.ITranslationUnit)2 TextSelection (org.eclipse.jface.text.TextSelection)2 ISelection (org.eclipse.jface.viewers.ISelection)2 TreeSelection (org.eclipse.jface.viewers.TreeSelection)2 IEditorPart (org.eclipse.ui.IEditorPart)2 ITextEditor (org.eclipse.ui.texteditor.ITextEditor)2 IFunction (org.eclipse.cdt.core.model.IFunction)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1