Search in sources :

Example 6 with CachegrindViewPart

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

Example 7 with CachegrindViewPart

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

Example 8 with CachegrindViewPart

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

the class BasicCachegrindTest method testFileNames.

@Test
public void testFileNames() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testFileNames");
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    CachegrindOutput output = view.getOutputs()[0];
    // $NON-NLS-1$
    CachegrindFile file = getFileByName(output, "cpptest.cpp");
    assertNotNull(file);
    // $NON-NLS-1$
    file = getFileByName(output, "cpptest.h");
    assertNotNull(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) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Example 9 with CachegrindViewPart

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

the class BasicCachegrindTest method testNumPIDs.

@Test
public void testNumPIDs() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testNumPIDs");
    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)

Example 10 with CachegrindViewPart

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

the class BasicCachegrindTest method testNumFunctions.

@Test
public void testNumFunctions() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testNumFunctions");
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    CachegrindOutput output = view.getOutputs()[0];
    // $NON-NLS-1$
    CachegrindFile file = getFileByName(output, "cpptest.cpp");
    assertNotNull(file);
    assertEquals(8, file.getFunctions().length);
}
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) 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