Ejemplo n.º 1
0
  public void testNumFunctions() throws Exception {
    ILaunchConfigurationWorkingCopy config =
        createConfiguration(proj.getProject()).getWorkingCopy();
    config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
    config.doSave();
    doLaunch(config, "testExec"); // $NON-NLS-1$

    CachegrindViewPart view =
        (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();

    int pidIx = 0;
    CachegrindOutput output = view.getOutputs()[pidIx];
    CachegrindFile file = getFileByName(output, "cpptest.cpp"); // $NON-NLS-1$
    if (file == null) {
      pidIx = 1;
      output = view.getOutputs()[pidIx];
      file = getFileByName(output, "cpptest.cpp"); // $NON-NLS-1$
    }
    assertNotNull(file);
    assertEquals(8, file.getFunctions().length);

    // test other pid
    pidIx = (pidIx + 1) % 2;
    output = view.getOutputs()[pidIx];
    file = getFileByName(output, "parent.cpp"); // $NON-NLS-1$
    assertNotNull(file);
    assertEquals(6, file.getFunctions().length);
  }
Ejemplo n.º 2
0
  public void testNoExec() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    doLaunch(config, "testNoExec"); // $NON-NLS-1$

    CachegrindViewPart view =
        (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    assertEquals(1, view.getOutputs().length);
  }
Ejemplo n.º 3
0
  public void testNumPids() throws Exception {
    ILaunchConfigurationWorkingCopy config =
        createConfiguration(proj.getProject()).getWorkingCopy();
    config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
    config.doSave();
    doLaunch(config, "testExec"); // $NON-NLS-1$

    CachegrindViewPart view =
        (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    assertEquals(2, view.getOutputs().length);
  }