1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-13 03:55:22 +02:00

parameterized tests gdb tests

this commit to introduce a test harness that allow
to reduce SIGNIFICALLY duplication of test per gdb version.
Tests is now parameterized with version and type (gdb vs gdbserver).
This commit flattens on of the tests as example rest is still 
using an old way.

Parameters are defined externally now via Java variable like this
 -Dcdt.tests.dsf.gdb.versions=gdb.7.7,gdbserver.7.7,gdb.7.11

Change-Id: I855449afba40e265c542dc5de7a3562548c97e8b
This commit is contained in:
Alena Laskavaia 2016-03-14 12:02:09 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent df63a59b53
commit b3f03996de
57 changed files with 1289 additions and 1789 deletions

View file

@ -439,7 +439,7 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
* @since 4.0 * @since 4.0
*/ */
protected boolean isNonStopSupportedInGdbVersion(String version) { protected boolean isNonStopSupportedInGdbVersion(String version) {
if (NON_STOP_FIRST_VERSION.compareTo(version) <= 0) { if (NON_STOP_FIRST_VERSION.compareTo(version) <= 0) {// XXX: 7.2 > 7.11 !!!
return true; return true;
} }
return false; return false;

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View file

@ -1,9 +1,8 @@
#Tue Jun 24 11:05:41 PDT 2008
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@ -67,4 +66,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.7 org.eclipse.jdt.core.compiler.source=1.8

View file

@ -19,7 +19,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.mockito, org.mockito,
org.hamcrest org.hamcrest
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: . Bundle-ClassPath: .
Export-Package: org.eclipse.cdt.dsf.mi.service;x-internal:=true, Export-Package: org.eclipse.cdt.dsf.mi.service;x-internal:=true,
org.eclipse.cdt.tests.dsf.gdb.framework;x-internal:=true, org.eclipse.cdt.tests.dsf.gdb.framework;x-internal:=true,

View file

@ -19,6 +19,7 @@
<dsf.gdb.tests.gdbPath>/shared/common/gdb/gdb-all/bin</dsf.gdb.tests.gdbPath> <dsf.gdb.tests.gdbPath>/shared/common/gdb/gdb-all/bin</dsf.gdb.tests.gdbPath>
<dsf.gdb.tests.gdbTestSuite>AutomatedSuite.java</dsf.gdb.tests.gdbTestSuite> <dsf.gdb.tests.gdbTestSuite>AutomatedSuite.java</dsf.gdb.tests.gdbTestSuite>
<dsf.gdb.tests.timeout.multiplier>1</dsf.gdb.tests.timeout.multiplier> <dsf.gdb.tests.timeout.multiplier>1</dsf.gdb.tests.timeout.multiplier>
<cdt.tests.dsf.gdb.versions>gdb.7.11,gdbserver.7.11</cdt.tests.dsf.gdb.versions>
</properties> </properties>
<build> <build>
<plugins> <plugins>
@ -58,7 +59,7 @@
<version>${tycho-version}</version> <version>${tycho-version}</version>
<configuration> <configuration>
<useUIHarness>false</useUIHarness> <useUIHarness>false</useUIHarness>
<argLine>${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m -Xmx512m -XX:MaxPermSize=256M -Dcdt.tests.dsf.gdb.path=${dsf.gdb.tests.gdbPath} -Ddsf.gdb.tests.timeout.multiplier=${dsf.gdb.tests.timeout.multiplier}</argLine> <argLine>${tycho.testArgLine} ${base.ui.test.vmargs} -ea -Xms256m -Xmx512m -XX:MaxPermSize=256M -Dcdt.tests.dsf.gdb.path=${dsf.gdb.tests.gdbPath} -Ddsf.gdb.tests.timeout.multiplier=${dsf.gdb.tests.timeout.multiplier} -Dcdt.tests.dsf.gdb.versions=${cdt.tests.dsf.gdb.versions}</argLine>
<includes> <includes>
<include>**/${dsf.gdb.tests.gdbTestSuite}</include> <include>**/${dsf.gdb.tests.gdbTestSuite}</include>
</includes> </includes>

View file

@ -0,0 +1,142 @@
/*******************************************************************************
* Copyright (c) 2016 QNX Software System and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Elena Laskavaia (QNX Software System) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.framework;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameter;
/**
* This is base test class for all parametrized classes (classes parameter is
* gdb version)
*/
@RunWith(Parameterized.class)
public abstract class BaseParametrizedTestCase extends BaseTestCase {
@Parameterized.Parameters(name = "{0}")
public static Collection<String> getVersions() {
return calculateVersions();
}
@Parameter public String parameter;
// other fields
private String gdbVersionPostfix; // this is how we want to invoke it
private boolean remote; // this is if we want remote tests (gdbserver)
protected static List<String> calculateVersions() {
if (globalVersion != null) {
// this is old tests. Version specific suite will set this value
return Collections.singletonList(globalVersion);
}
String gdbVersions = System.getProperty("cdt.tests.dsf.gdb.versions");
if (gdbVersions == null) {
// this has to be put in maven using -Dcdt.tests.dsf.gdb.versions or in junit config if you run locally
// like this -Dcdt.tests.dsf.gdb.versions=gdb.7.7,gdbserver.7.7
gdbVersions = "gdb,gdbserver";
}
String[] versions = gdbVersions.split(",");
return Arrays.asList(versions);
}
protected void parseParameter() {
if (gdbVersionPostfix == null && parameter != null) {
parameter = parameter.trim();
if (parameter.startsWith("gdbserver")) { // remote
remote = true;
gdbVersionPostfix = parameter.replaceAll("^gdbserver\\.?", "");
} else if (parameter.startsWith("gdb")) { // local
remote = false;
gdbVersionPostfix = parameter.replaceAll("^gdb\\.?", "");
} else { // then it is just local and just version number
remote = false;
gdbVersionPostfix = parameter;
}
if (gdbVersionPostfix.isEmpty())
gdbVersionPostfix = "default";
}
}
public static void resetGlobalState() {
BaseTestCase.removeGlobalLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME);
BaseTestCase.removeGlobalLaunchAttribute(BaseTestCase.ATTR_DEBUG_SERVER_NAME);
BaseTestCase.removeGlobalLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE);
globalVersion = null;
}
public void assumeGdbVersionLowerThen(String checkVersion) {
String gdbVersion = getGdbVersion();
// otherwise it has to be strictly lower
boolean isLower = LaunchUtils.compareVersions(checkVersion, gdbVersion) > 0;
Assume.assumeTrue(
"Skipped because gdb " + gdbVersion + " does not support this feature: removed since " + checkVersion,
isLower);
}
protected String getGdbVersion() {
if (gdbVersionPostfix==null) gdbVersionPostfix=globalVersion;
String gdbPath = getProgramPath("gdb", gdbVersionPostfix);
return getGdbVersion(gdbPath);
}
public void assumeGdbVersionAtLeast(String checkVersion) {
String gdbVersion = getGdbVersion();
if (gdbVersion == GDB_NOT_FOUND) {
String gdbPath = getProgramPath("gdb", gdbVersionPostfix);
// fail assumption
Assume.assumeFalse("GDB cannot be run " + gdbPath, true);
}
if (checkVersion == null || checkVersion.isEmpty() || checkVersion.equals("default"))
return; // no version restrictions
if (checkVersion.equals(gdbVersion))
return;
// otherwise it has to be same of higher
boolean isSupported = LaunchUtils.compareVersions(checkVersion, gdbVersion) <= 0;
Assume.assumeTrue("Skipped because gdb " + gdbVersion + " does not support this feature: since " + checkVersion,
isSupported);
}
@Override
protected void setGdbVersion() {
// this will be ignored in new style tests
}
@Override
protected void initializeLaunchAttributes() {
parseParameter();
if (gdbVersionPostfix == null) {
// we are not running parametrized
setGdbVersion(); // old way
gdbVersionPostfix = globalVersion;
} else {
String gdbPath = getProgramPath("gdb", gdbVersionPostfix);
String gdbServerPath = getProgramPath("gdbserver", gdbVersionPostfix);
assumeGdbVersionAtLeast(gdbVersionPostfix);
setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbPath);
setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, gdbServerPath);
if (remote)
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
}
}
@AfterClass
public static void afterClass() {
BaseParametrizedTestCase.resetGlobalState();
}
}

View file

@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Ericsson - Initial Implementation * Ericsson - Initial Implementation
* Simon Marchi (Ericsson) - Add and use runningOnWindows(). * Simon Marchi (Ericsson) - Add and use runningOnWindows().
@ -25,6 +25,8 @@ import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Set; import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.datamodel.IDMEvent; import org.eclipse.cdt.dsf.datamodel.IDMEvent;
@ -33,6 +35,7 @@ import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.internal.GdbDebugOptions; import org.eclipse.cdt.dsf.gdb.internal.GdbDebugOptions;
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch;
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
import org.eclipse.cdt.dsf.mi.service.command.events.IMIDMEvent; import org.eclipse.cdt.dsf.mi.service.command.events.IMIDMEvent;
import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent; import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent;
import org.eclipse.cdt.dsf.mi.service.command.output.MIFrame; import org.eclipse.cdt.dsf.mi.service.command.output.MIFrame;
@ -83,61 +86,75 @@ public class BaseTestCase {
// Timeout value for each individual test // Timeout value for each individual test
private final static int TEST_TIMEOUT = 5 * 60 * 1000; // 5 minutes in milliseconds private final static int TEST_TIMEOUT = 5 * 60 * 1000; // 5 minutes in milliseconds
// Make the current test name available through testName.getMethodName() // Make the current test name available through testName.getMethodName()
@Rule public TestName testName = new TestName(); @Rule public TestName testName = new TestName();
// Add a timeout for each test, to make sure no test hangs // Add a timeout for each test, to make sure no test hangs
@Rule public TestRule timeout = new Timeout(TEST_TIMEOUT); @Rule public TestRule timeout = new Timeout(TEST_TIMEOUT, TimeUnit.MILLISECONDS);
public static final String ATTR_DEBUG_SERVER_NAME = TestsPlugin.PLUGIN_ID + ".DEBUG_SERVER_NAME"; public static final String ATTR_DEBUG_SERVER_NAME = TestsPlugin.PLUGIN_ID + ".DEBUG_SERVER_NAME";
private static final String DEFAULT_EXEC_NAME = "GDBMIGenericTestApp.exe"; private static final String DEFAULT_EXEC_NAME = "GDBMIGenericTestApp.exe";
private static GdbLaunch fLaunch; private static GdbLaunch fLaunch;
// The set of attributes used for the launch of a single test. // The set of attributes used for the launch of a single test.
private Map<String, Object> launchAttributes; private Map<String, Object> launchAttributes;
// A set of global launch attributes which are not // A set of global launch attributes which are not
// reset when we load a new class of tests. // reset when we load a new class of tests.
// This allows a Suite to set an attribute // This allows a SuiteGdb to set an attribute
// The suite is responsible for clearing those attributes // The suite is responsible for clearing those attributes
// once it is finished // once it is finished
private static Map<String, Object> globalLaunchAttributes = new HashMap<String, Object>(); private static Map<String, Object> globalLaunchAttributes = new HashMap<String, Object>();
private static Process gdbserverProc; private static Process gdbserverProc;
/** The MI event associated with the breakpoint at main() */ /** The MI event associated with the breakpoint at main() */
private MIStoppedEvent fInitialStoppedEvent; private MIStoppedEvent fInitialStoppedEvent;
/** Flag we set to true when the target has reached the breakpoint at main() */ /** Flag we set to true when the target has reached the breakpoint at main() */
private boolean fTargetSuspended; private boolean fTargetSuspended;
/** Event semaphore we set when the target has reached the breakpoint at main() */ /** Event semaphore we set when the target has reached the breakpoint at main() */
final private String fTargetSuspendedSem = new String(); // just used as a semaphore final private Object fTargetSuspendedSem = new Object(); // just used as a semaphore
private static boolean fgStatusHandlersEnabled = true; private static boolean fgStatusHandlersEnabled = true;
/** global cache of gdb versions, to avoid running gdb every time just to check if it is present*/
private static Map<String, String> gdbCache = new HashMap<>();
protected static String globalVersion;
protected static final String GDB_NOT_FOUND = "not found";
private HashMap<String, Integer> fTagLocations = new HashMap<>(); private HashMap<String, Integer> fTagLocations = new HashMap<>();
public GdbLaunch getGDBLaunch() { return fLaunch; } public GdbLaunch getGDBLaunch() { return fLaunch; }
public void setLaunchAttribute(String key, Object value) { public void setLaunchAttribute(String key, Object value) {
launchAttributes.put(key, value); launchAttributes.put(key, value);
} }
public void removeLaunchAttribute(String key) { public void removeLaunchAttribute(String key) {
launchAttributes.remove(key); launchAttributes.remove(key);
} }
public Object getLaunchAttribute(String key) {
return launchAttributes.get(key);
}
public static void setGlobalLaunchAttribute(String key, Object value) { public static void setGlobalLaunchAttribute(String key, Object value) {
globalLaunchAttributes.put(key, value); globalLaunchAttributes.put(key, value);
} }
public static Object getGlobalLaunchAttribite(String key){
return globalLaunchAttributes.get(key);
}
public static void removeGlobalLaunchAttribute(String key) { public static void removeGlobalLaunchAttribute(String key) {
globalLaunchAttributes.remove(key); globalLaunchAttributes.remove(key);
} }
public synchronized MIStoppedEvent getInitialStoppedEvent() { return fInitialStoppedEvent; } public synchronized MIStoppedEvent getInitialStoppedEvent() { return fInitialStoppedEvent; }
public boolean isRemoteSession() { public boolean isRemoteSession() {
@ -158,16 +175,16 @@ public class BaseTestCase {
fSession = session; fSession = session;
Assert.assertNotNull(session); Assert.assertNotNull(session);
} }
@DsfServiceEventHandler @DsfServiceEventHandler
public void eventDispatched(IDMEvent<?> event) { public void eventDispatched(IDMEvent<?> event) {
// Wait for the program to have stopped on main. // Wait for the program to have stopped on main.
// //
// We have to jump through hoops to properly handle the remote // We have to jump through hoops to properly handle the remote
// case, because of differences between GDB <= 68 and GDB >= 7.0. // case, because of differences between GDB <= 68 and GDB >= 7.0.
// //
// With GDB >= 7.0, when connecting to the remote gdbserver, // With GDB >= 7.0, when connecting to the remote gdbserver,
// we get a first *stopped event at connection time. This is // we get a first *stopped event at connection time. This is
// not the ISuspendedDMEvent event we want. We could instead // not the ISuspendedDMEvent event we want. We could instead
// listen for an IBreakpointHitDMEvent instead. // listen for an IBreakpointHitDMEvent instead.
// However, with GDB <= 6.8, temporary breakpoints are not // However, with GDB <= 6.8, temporary breakpoints are not
@ -190,14 +207,14 @@ public class BaseTestCase {
// Check the content of the frame for the method we should stop at // Check the content of the frame for the method we should stop at
String stopAt = (String)launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL); String stopAt = (String)launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL);
if (stopAt == null) stopAt = "main"; if (stopAt == null) stopAt = "main";
MIFrame frame = fInitialStoppedEvent.getFrame(); MIFrame frame = fInitialStoppedEvent.getFrame();
if (frame != null && if (frame != null &&
frame.getFunction() != null && frame.getFunction().indexOf(stopAt) != -1) { frame.getFunction() != null && frame.getFunction().indexOf(stopAt) != -1) {
// Set the event semaphore that will allow the test to proceed // Set the event semaphore that will allow the test to proceed
synchronized (fTargetSuspendedSem) { synchronized (fTargetSuspendedSem) {
fTargetSuspended = true; fTargetSuspended = true;
fTargetSuspendedSem.notify(); fTargetSuspendedSem.notify();
} }
// We found our event, no further need for this listener // We found our event, no further need for this listener
@ -241,17 +258,17 @@ public class BaseTestCase {
protected void setLaunchAttributes() { protected void setLaunchAttributes() {
// Clear all launch attributes before starting a new test // Clear all launch attributes before starting a new test
launchAttributes = new HashMap<String, Object>(); launchAttributes = new HashMap<String, Object>();
launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + DEFAULT_EXEC_NAME); launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + DEFAULT_EXEC_NAME);
launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true); launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT);
launchAttributes.put(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); launchAttributes.put(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit");
if (launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE) == null) {
launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN ); launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN );
}
// Set these up in case we will be running Remote tests. They will be ignored if we don't // Set these up in case we will be running Remote tests. They will be ignored if we don't
launchAttributes.put(ATTR_DEBUG_SERVER_NAME, "gdbserver"); launchAttributes.put(ATTR_DEBUG_SERVER_NAME, "gdbserver");
launchAttributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, true); launchAttributes.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, true);
@ -259,12 +276,23 @@ public class BaseTestCase {
launchAttributes.put(IGDBLaunchConfigurationConstants.ATTR_PORT, "9999"); launchAttributes.put(IGDBLaunchConfigurationConstants.ATTR_PORT, "9999");
launchAttributes.put(ITestConstants.LAUNCH_GDB_SERVER, true); launchAttributes.put(ITestConstants.LAUNCH_GDB_SERVER, true);
setGdbVersion(); initializeLaunchAttributes();
// Set the global launch attributes // Set the global launch attributes
launchAttributes.putAll(globalLaunchAttributes); launchAttributes.putAll(globalLaunchAttributes);
} }
/**
* Override this method to initialize test specific launch attributes.
* Use {@link #setLaunchAttribute(String, Object)} method to set them.
* Don't need to clean it up its local to a specific test method.
* Note that global attributes will override these values.
* If it is undesired override {@link #setLaunchAttributes()} method instead
*/
protected void initializeLaunchAttributes() {
setGdbVersion();
}
/** /**
* Given a set of tags (strings) to find in sourceFile, populate the * Given a set of tags (strings) to find in sourceFile, populate the
* fTagLocations map with the line numbers where they are found. * fTagLocations map with the line numbers where they are found.
@ -280,32 +308,24 @@ public class BaseTestCase {
new BufferedReader(new FileReader(SOURCE_PATH + sourceName))) { new BufferedReader(new FileReader(SOURCE_PATH + sourceName))) {
Set<String> tagsToFind = new HashSet<>(Arrays.asList(tags)); Set<String> tagsToFind = new HashSet<>(Arrays.asList(tags));
String line; String line;
int lineNumber = 1;
int numberFound = 0;
line = reader.readLine(); for (int lineNumber = 1; (line = reader.readLine()) != null; lineNumber++) {
while (line != null) {
for (String tag : tagsToFind) { for (String tag : tagsToFind) {
if (line.contains(tag)) { if (line.contains(tag)) {
if (fTagLocations.containsKey(tag)) { if (fTagLocations.containsKey(tag)) {
throw new RuntimeException("Tag " + tag throw new RuntimeException("Tag " + tag
+ " was found twice in " + sourceName); + " was found twice in " + sourceName);
} }
fTagLocations.put(tag, lineNumber); fTagLocations.put(tag, lineNumber);
numberFound++; tagsToFind.remove(tag);
break; break;
} }
} }
lineNumber++;
line = reader.readLine();
} }
/* Make sure all tags have been found */ /* Make sure all tags have been found */
if (numberFound != tagsToFind.size()) { if (!tagsToFind.isEmpty()) {
throw new RuntimeException( throw new RuntimeException(
"Some tags were not found in " + sourceName); "Tags " + tagsToFind + " were not found in " + sourceName);
} }
} }
} }
@ -332,31 +352,31 @@ public class BaseTestCase {
*/ */
protected void doLaunch() throws Exception { protected void doLaunch() throws Exception {
boolean remote = isRemoteSession(); boolean remote = isRemoteSession();
if (GdbDebugOptions.DEBUG) { if (GdbDebugOptions.DEBUG) {
GdbDebugOptions.trace("===============================================================================================\n"); GdbDebugOptions.trace("===============================================================================================\n");
GdbDebugOptions.trace(String.format("%s \"%s\" launching %s %s\n", GdbDebugOptions.trace(String.format("%s \"%s\" launching %s %s\n",
GdbPlugin.getDebugTime(), testName.getMethodName(), launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME), remote ? "with gdbserver" : "")); GdbPlugin.getDebugTime(), testName.getMethodName(), launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME), remote ? "with gdbserver" : ""));
GdbDebugOptions.trace("===============================================================================================\n"); GdbDebugOptions.trace("===============================================================================================\n");
} }
boolean postMortemLaunch = launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE) boolean postMortemLaunch = launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE)
.equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE); .equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE);
launchGdbServer(); launchGdbServer();
ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager(); ILaunchManager launchMgr = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType lcType = launchMgr.getLaunchConfigurationType("org.eclipse.cdt.tests.dsf.gdb.TestLaunch"); ILaunchConfigurationType lcType = launchMgr.getLaunchConfigurationType("org.eclipse.cdt.tests.dsf.gdb.TestLaunch");
assert lcType != null; assert lcType != null;
ILaunchConfigurationWorkingCopy lcWorkingCopy = lcType.newInstance( ILaunchConfigurationWorkingCopy lcWorkingCopy = lcType.newInstance(
null, null,
launchMgr.generateLaunchConfigurationName("Test Launch")); //$NON-NLS-1$ launchMgr.generateLaunchConfigurationName("Test Launch")); //$NON-NLS-1$
assert lcWorkingCopy != null; assert lcWorkingCopy != null;
lcWorkingCopy.setAttributes(launchAttributes); lcWorkingCopy.setAttributes(launchAttributes);
final ILaunchConfiguration lc = lcWorkingCopy.doSave(); final ILaunchConfiguration lc = lcWorkingCopy.doSave();
// Register ourselves as a listener for the new session so that we can // Register ourselves as a listener for the new session so that we can
// register ourselves with that particular session before any events // register ourselves with that particular session before any events
// occur. We want to find out when the break on main() occurs. // occur. We want to find out when the break on main() occurs.
@ -365,7 +385,7 @@ public class BaseTestCase {
public void sessionStarted(DsfSession session) { public void sessionStarted(DsfSession session) {
session.addServiceEventListener(new SessionEventListener(session), null); session.addServiceEventListener(new SessionEventListener(session), null);
} }
}; };
// Launch the debug session. The session-started listener will be called // Launch the debug session. The session-started listener will be called
// before the launch() call returns (unless, of course, there was a // before the launch() call returns (unless, of course, there was a
@ -374,7 +394,7 @@ public class BaseTestCase {
fLaunch = (GdbLaunch)lc.launch(ILaunchManager.DEBUG_MODE, new NullProgressMonitor()); fLaunch = (GdbLaunch)lc.launch(ILaunchManager.DEBUG_MODE, new NullProgressMonitor());
DsfSession.removeSessionStartedListener(sessionStartedListener); DsfSession.removeSessionStartedListener(sessionStartedListener);
// If we haven't hit main() yet, // If we haven't hit main() yet,
// wait for the program to hit the breakpoint at main() before // wait for the program to hit the breakpoint at main() before
// proceeding. All tests assume that stable initial state. Two // proceeding. All tests assume that stable initial state. Two
// seconds is plenty; we typically get to that state in a few // seconds is plenty; we typically get to that state in a few
@ -392,12 +412,12 @@ public class BaseTestCase {
Assert.assertNotNull(fInitialStoppedEvent); Assert.assertNotNull(fInitialStoppedEvent);
} }
} }
// If we started a gdbserver add it to the launch to make sure it is killed at the end // If we started a gdbserver add it to the launch to make sure it is killed at the end
if (gdbserverProc != null) { if (gdbserverProc != null) {
DebugPlugin.newProcess(fLaunch, gdbserverProc, "gdbserver"); DebugPlugin.newProcess(fLaunch, gdbserverProc, "gdbserver");
} }
// Now initialize our SyncUtility, since we have the launcher // Now initialize our SyncUtility, since we have the launcher
SyncUtil.initialize(fLaunch.getSession()); SyncUtil.initialize(fLaunch.getSession());
@ -462,7 +482,7 @@ public class BaseTestCase {
GdbDebugOptions.trace("Error while launching command: " + commandLine + "\n"); GdbDebugOptions.trace("Error while launching command: " + commandLine + "\n");
e.printStackTrace(); e.printStackTrace();
assert false; assert false;
} }
} }
} }
} }
@ -470,29 +490,34 @@ public class BaseTestCase {
/** /**
* Sets the name of the gdb and gdbserver programs into the launch * Sets the name of the gdb and gdbserver programs into the launch
* configuration used by the test class. * configuration used by the test class.
* *
* <p> * <p>
* Leaf subclasses are specific to a particular version of GDB and must call * Leaf subclasses are specific to a particular version of GDB and must call
* this from their "@BeforeClass" static method so that we end up invoking * this from their "@BeforeClass" static method so that we end up invoking
* the appropriate gdb. * the appropriate gdb.
* *
* @param version * @param version
* string that contains the major and minor version number, e.g., * string that contains the major and minor version number, e.g.,
* "6.8" * "6.8", special constant "default" represent default gdb on the box (called as "gdb")
*/ */
public static void setGdbProgramNamesLaunchAttributes(String version) { public static void setGdbProgramNamesLaunchAttributes(String version) {
// See bugzilla 303811 for why we have to append ".exe" on Windows globalVersion = version;
boolean isWindows = runningOnWindows(); setGlobalLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, getProgramPath("gdb", version));
String gdbPath = System.getProperty("cdt.tests.dsf.gdb.path"); setGlobalLaunchAttribute(ATTR_DEBUG_SERVER_NAME, getProgramPath("gdbserver", version));
String debugName = "gdb." + version + (isWindows ? ".exe" : "");
String debugServerName = "gdbserver." + version + (isWindows ? ".exe" : "");
if (gdbPath != null) {
debugName = gdbPath + "/" + debugName;
debugServerName = gdbPath + "/" + debugServerName;
}
setGlobalLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, debugName);
setGlobalLaunchAttribute(ATTR_DEBUG_SERVER_NAME, debugServerName);
} }
public static String getProgramPath(String main, String version) {
// See bugzilla 303811 for why we have to append ".exe" on Windows
boolean isWindows = runningOnWindows();
String gdbPath = System.getProperty("cdt.tests.dsf.gdb.path");
String fileExtension = isWindows ? ".exe" : "";
String versionPostfix = (!version.equals("default")) ? "." + version : "";
String debugName = main + versionPostfix + fileExtension;
if (gdbPath != null) {
debugName = gdbPath + "/" + debugName;
}
return debugName;
}
public static boolean supportsNonStop() { public static boolean supportsNonStop() {
return !(runningOnWindows() || runningOnMac()); return !(runningOnWindows() || runningOnMac());
@ -504,19 +529,49 @@ public class BaseTestCase {
/** /**
* This method will verify that the GDB binary is available, and if it is not, the test will * This method will verify that the GDB binary is available, and if it is not, the test will
* be ignored. This method should be called by a Suite that specifies a specific GDB version. * be ignored. This method should be called by a SuiteGdb that specifies a specific GDB version.
*/ */
public static void ignoreIfGDBMissing() { public static void ignoreIfGDBMissing() {
try { String gdb = (String) globalLaunchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME);
// See if we can find GDB by actually running it. String version = getGdbVersion(gdb);
String gdb = (String)globalLaunchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME); // If we cannot run GDB, just ignore the test case.
Process process = ProcessFactory.getFactory().exec(gdb + " --version"); Assume.assumeFalse("GDB cannot be run " + gdb, version == GDB_NOT_FOUND);
process.destroy(); }
} catch (IOException e) {
// If we cannot run GDB, just ignore the test case. protected static String getGdbVersion(String gdb) {
Assume.assumeNoException(e); try {
} // See if we can find GDB by actually running it.
} String version = gdbCache.get(gdb);
if (version == null) {
version = doReadGdbVersion(gdb);
gdbCache.put(gdb, version);
}
return version;
} catch (IOException e) {
gdbCache.put(gdb, GDB_NOT_FOUND);
return GDB_NOT_FOUND;
}
}
protected static String doReadGdbVersion(String gdb) throws IOException {
Process process = ProcessFactory.getFactory().exec(gdb + " --version");
try {
String streamOutput;
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(process.getInputStream()))) {
streamOutput = buffer.lines().collect(Collectors.joining("\n"));
}
String gdbVersion = LaunchUtils.getGDBVersionFromText(streamOutput);
return gdbVersion;
} finally {
try {
process.getOutputStream().close();
process.getErrorStream().close();
process.destroy();
} catch (IOException e) {
// ignore these
}
}
}
protected static boolean runningOnWindows() { protected static boolean runningOnWindows() {
return Platform.getOS().equals(Platform.OS_WIN32); return Platform.getOS().equals(Platform.OS_WIN32);
@ -538,5 +593,5 @@ public class BaseTestCase {
public static void restoreGlobalPreferences() { public static void restoreGlobalPreferences() {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier()); IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
node.putBoolean(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, fgStatusHandlersEnabled); node.putBoolean(IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, fgStatusHandlersEnabled);
} }
} }

View file

@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Ericsson - Initial Implementation * Ericsson - Initial Implementation
*******************************************************************************/ *******************************************************************************/
@ -29,7 +29,7 @@ import org.junit.runners.Suite;
* the annotations which list all the different JUnit suites we * the annotations which list all the different JUnit suites we
* want to run. When creating a new suite class, it should be * want to run. When creating a new suite class, it should be
* added to the list below. * added to the list below.
* *
* This suite runs all the other suites. * This suite runs all the other suites.
*/ */

View file

@ -4,27 +4,22 @@
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Marc Khouzam (Ericsson) - Initial Implementation * Marc Khouzam (Ericsson) - Initial Implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests; package org.eclipse.cdt.tests.dsf.gdb.tests;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.Suite_7_11;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
/** /**
* This suite runs all suites that are part of the tests * This suite runs all suites that are part of the tests automatically run with
* automatically run with each CDT build. * each CDT build.
*/ */
@RunWith(Suite.class) @RunWith(Suite.class)
@Suite.SuiteClasses({ @Suite.SuiteClasses({
Suite_7_11.class, SuiteGdb.class,
// Can't run the Remote test just yet because they
// have the same names on the local tests, which is
// not handled by JUnit (https://bugs.eclipse.org/172256)
}) })
public class AutomatedSuite {
public class AutomatedSuite {} }

View file

@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Ericsson - Initial Implementation * Ericsson - Initial Implementation
* Simon Marchi (Ericsson) - Add and use runningOnWindows(). * Simon Marchi (Ericsson) - Add and use runningOnWindows().
@ -58,38 +58,38 @@ import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.cdt.gdb.eventbkpts.IEventBreakpointConstants; import org.eclipse.cdt.gdb.eventbkpts.IEventBreakpointConstants;
import org.eclipse.cdt.gdb.internal.eventbkpts.GdbCatchpoints; import org.eclipse.cdt.gdb.internal.eventbkpts.GdbCatchpoints;
import org.eclipse.cdt.tests.dsf.gdb.framework.AsyncCompletionWaitor; import org.eclipse.cdt.tests.dsf.gdb.framework.AsyncCompletionWaitor;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseParametrizedTestCase;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.framework.SyncUtil; import org.eclipse.cdt.tests.dsf.gdb.framework.SyncUtil;
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin; import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
/** /**
* This is the test suite for the catchpoint support in DSF-GDB. * This is the test suite for the catchpoint support in DSF-GDB.
* *
* It is meant to be a regression suite to be executed automatically against the * It is meant to be a regression suite to be executed automatically against the
* DSF nightly builds. * DSF nightly builds.
* *
* It is also meant to be augmented with a proper test case(s) every time a * It is also meant to be augmented with a proper test case(s) every time a
* feature is added or in the event (unlikely :-) that a bug is found in the * feature is added or in the event (unlikely :-) that a bug is found in the
* Breakpoint Service. * Breakpoint Service.
* *
* Refer to the JUnit4 documentation for an explanation of the annotations. * Refer to the JUnit4 documentation for an explanation of the annotations.
* *
*/ */
@RunWith(BackgroundRunner.class) @RunWith(Parameterized.class)
public class MICatchpointsTest extends BaseTestCase { public class MICatchpointsTest extends BaseParametrizedTestCase {
private static final String EXEC_NAME = "CatchpointTestApp.exe"; //$NON-NLS-1$ private static final String EXEC_NAME = "CatchpointTestApp.exe"; //$NON-NLS-1$
private static final String SOURCE_NAME = "CatchpointTestApp.cc"; //$NON-NLS-1$ private static final String SOURCE_NAME = "CatchpointTestApp.cc"; //$NON-NLS-1$
public static final int LINE_NUMBER_SLEEP_CALL = 17; public static final int LINE_NUMBER_SLEEP_CALL = 17;
// Asynchronous Completion // Asynchronous Completion
private final AsyncCompletionWaitor fWait = new AsyncCompletionWaitor(); private final AsyncCompletionWaitor fWait = new AsyncCompletionWaitor();
// Services references // Services references
private DsfSession fSession; private DsfSession fSession;
private IBreakpointsTargetDMContext fBreakpointsDmc; private IBreakpointsTargetDMContext fBreakpointsDmc;
@ -97,7 +97,7 @@ public class MICatchpointsTest extends BaseTestCase {
private MIRunControl fRunControl; private MIRunControl fRunControl;
private IBreakpoints fBreakpointService; private IBreakpoints fBreakpointService;
private IExpressions fExpressionService; private IExpressions fExpressionService;
// Event Management // Event Management
private static Boolean fEventHandlerLock = true; private static Boolean fEventHandlerLock = true;
private enum Events { BP_ADDED, BP_UPDATED, BP_REMOVED, BP_HIT } private enum Events { BP_ADDED, BP_UPDATED, BP_REMOVED, BP_HIT }
@ -105,10 +105,10 @@ public class MICatchpointsTest extends BaseTestCase {
private final int BP_UPDATED = Events.BP_UPDATED.ordinal(); private final int BP_UPDATED = Events.BP_UPDATED.ordinal();
private final int BP_REMOVED = Events.BP_REMOVED.ordinal(); private final int BP_REMOVED = Events.BP_REMOVED.ordinal();
private final int BP_HIT = Events.BP_HIT.ordinal(); private final int BP_HIT = Events.BP_HIT.ordinal();
/** number of times a breakpoint event was received, broken down by event type */ /** number of times a breakpoint event was received, broken down by event type */
private int[] fBreakpointEvents = new int[Events.values().length]; private int[] fBreakpointEvents = new int[Events.values().length];
/** total number of breakpoint events received */ /** total number of breakpoint events received */
private int totalBreakpointEventsCount() { private int totalBreakpointEventsCount() {
synchronized (fEventHandlerLock) { synchronized (fEventHandlerLock) {
@ -119,8 +119,8 @@ public class MICatchpointsTest extends BaseTestCase {
return total; return total;
} }
} }
/** /**
* The gdb breakpoint number associated with the most recent breakpoint event * The gdb breakpoint number associated with the most recent breakpoint event
*/ */
@ -139,7 +139,7 @@ public class MICatchpointsTest extends BaseTestCase {
// Error messages // Error messages
private final String UNKNOWN_EXECUTION_CONTEXT = "Unknown execution context"; private final String UNKNOWN_EXECUTION_CONTEXT = "Unknown execution context";
private final String UNKNOWN_BREAKPOINT = "Unknown breakpoint"; private final String UNKNOWN_BREAKPOINT = "Unknown breakpoint";
// ======================================================================== // ========================================================================
// Housekeeping stuff // Housekeeping stuff
// ======================================================================== // ========================================================================
@ -155,7 +155,7 @@ public class MICatchpointsTest extends BaseTestCase {
public void run() { public void run() {
fServicesTracker = new DsfServicesTracker(TestsPlugin.getBundleContext(), fSession.getId()); fServicesTracker = new DsfServicesTracker(TestsPlugin.getBundleContext(), fSession.getId());
assertNotNull(fServicesTracker); assertNotNull(fServicesTracker);
fRunControl = fServicesTracker.getService(MIRunControl.class); fRunControl = fServicesTracker.getService(MIRunControl.class);
assertNotNull(fRunControl); assertNotNull(fRunControl);
@ -173,7 +173,7 @@ public class MICatchpointsTest extends BaseTestCase {
} }
}; };
fSession.getExecutor().submit(runnable).get(); fSession.getExecutor().submit(runnable).get();
IContainerDMContext containerDmc = SyncUtil.getContainerContext(); IContainerDMContext containerDmc = SyncUtil.getContainerContext();
fBreakpointsDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class); fBreakpointsDmc = DMContexts.getAncestorOfType(containerDmc, IBreakpointsTargetDMContext.class);
assertNotNull(fBreakpointsDmc); assertNotNull(fBreakpointsDmc);
@ -182,31 +182,31 @@ public class MICatchpointsTest extends BaseTestCase {
@Override @Override
protected void setLaunchAttributes() { protected void setLaunchAttributes() {
super.setLaunchAttributes(); super.setLaunchAttributes();
// Select the binary to run the tests against // Select the binary to run the tests against
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME);
} }
@Override @Override
public void doAfterTest() throws Exception { public void doAfterTest() throws Exception {
super.doAfterTest(); super.doAfterTest();
if (fSession != null) {
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
@Override @Override
public void run() { public void run() {
fRunControl.getSession().removeServiceEventListener(MICatchpointsTest.this); fRunControl.getSession().removeServiceEventListener(MICatchpointsTest.this);
} }
}; };
fSession.getExecutor().submit(runnable).get(); fSession.getExecutor().submit(runnable).get();
}
// Clear the references (not strictly necessary) // Clear the references (not strictly necessary)
fBreakpointService = null; fBreakpointService = null;
fRunControl = null; fRunControl = null;
fServicesTracker.dispose(); if (fServicesTracker != null)
fServicesTracker = null; fServicesTracker.dispose();
fServicesTracker = null;
clearEventCounters(); clearEventCounters();
} }
// ======================================================================== // ========================================================================
// Event Management Functions // Event Management Functions
@ -282,7 +282,7 @@ public class MICatchpointsTest extends BaseTestCase {
* Suspends the calling thread until [count] number of breakpoint events * Suspends the calling thread until [count] number of breakpoint events
* have been received in the current test. NOTE: too simple for real life * have been received in the current test. NOTE: too simple for real life
* but good enough for this test suite * but good enough for this test suite
* *
* @param count * @param count
* the number breakpoint events to wait for * the number breakpoint events to wait for
* @param timeout * @param timeout
@ -305,7 +305,7 @@ public class MICatchpointsTest extends BaseTestCase {
} }
} }
} }
/** /**
* Simplified variant that just waits up to two seconds * Simplified variant that just waits up to two seconds
*/ */
@ -598,7 +598,7 @@ public class MICatchpointsTest extends BaseTestCase {
fWait.getMessage().contains(expected)); fWait.getMessage().contains(expected));
// Ensure that no breakpoint events were received // Ensure that no breakpoint events were received
assertEquals("Unexpected number of breakpoint events", 0, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 0, totalBreakpointEventsCount());
} }
// Long story. There's really no way for the user to set a disabled // Long story. There's really no way for the user to set a disabled
@ -613,7 +613,7 @@ public class MICatchpointsTest extends BaseTestCase {
// disabled breakpoint. When we do, this test will become relevant. // disabled breakpoint. When we do, this test will become relevant.
// @Test // @Test
// public void insertCatchpoint_Disabled() throws Throwable { // public void insertCatchpoint_Disabled() throws Throwable {
// // Create a catchpoint // // Create a catchpoint
// Map<String, Object> breakpoint = new HashMap<String, Object>(); // Map<String, Object> breakpoint = new HashMap<String, Object>();
// breakpoint.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT); // breakpoint.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT);
// breakpoint.put(MIBreakpoints.CATCHPOINT_TYPE, "throw"); // breakpoint.put(MIBreakpoints.CATCHPOINT_TYPE, "throw");
@ -743,7 +743,7 @@ public class MICatchpointsTest extends BaseTestCase {
} }
/** /**
* Set a catchpoint while the target is running and ensure it gets hit. * Set a catchpoint while the target is running and ensure it gets hit.
*/ */
@Test @Test
public void insertCatchpoint_WhileTargetRunning() throws Throwable { public void insertCatchpoint_WhileTargetRunning() throws Throwable {
@ -756,10 +756,10 @@ public class MICatchpointsTest extends BaseTestCase {
if (runningOnWindows()) { if (runningOnWindows()) {
return; return;
} }
// Run the program. It will make a two second sleep() call, during which time... // Run the program. It will make a two second sleep() call, during which time...
SyncUtil.resume(); SyncUtil.resume();
// Set a throw catchpoint; don't use the utility method since it assumes // Set a throw catchpoint; don't use the utility method since it assumes
// the target is running // the target is running
Map<String, Object> bkptsProps = new HashMap<String, Object>(); Map<String, Object> bkptsProps = new HashMap<String, Object>();
@ -767,21 +767,21 @@ public class MICatchpointsTest extends BaseTestCase {
bkptsProps.put(MIBreakpoints.CATCHPOINT_TYPE, "throw"); bkptsProps.put(MIBreakpoints.CATCHPOINT_TYPE, "throw");
insertBreakpoint(fBreakpointsDmc, bkptsProps); insertBreakpoint(fBreakpointsDmc, bkptsProps);
assertTrue(fWait.getMessage(), fWait.isOK()); assertTrue(fWait.getMessage(), fWait.isOK());
// After the sleep, the test app throws a C++ exception. Wait for the // After the sleep, the test app throws a C++ exception. Wait for the
// catchpoint to hit and for the expected number of breakpoint events to // catchpoint to hit and for the expected number of breakpoint events to
// have occurred // have occurred
MIStoppedEvent event = SyncUtil.waitForStop(3000); MIStoppedEvent event = SyncUtil.waitForStop(3000);
waitForBreakpointEvent(2); waitForBreakpointEvent(2);
// Ensure that right breakpoint events were received. One indicating the // Ensure that right breakpoint events were received. One indicating the
// catchpoint was created, another indicating it was hit // catchpoint was created, another indicating it was hit
waitForBreakpointEvent(1); waitForBreakpointEvent(1);
assertEquals("Unexpected number of breakpoint events", 2, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 2, totalBreakpointEventsCount());
assertEquals("Unexpected number of breakpoint-added events", 1, getBreakpointEventCount(BP_ADDED)); assertEquals("Unexpected number of breakpoint-added events", 1, getBreakpointEventCount(BP_ADDED));
assertEquals("Unexpected number of breakpoint-hit events", 1, getBreakpointEventCount(BP_HIT)); assertEquals("Unexpected number of breakpoint-hit events", 1, getBreakpointEventCount(BP_HIT));
clearEventCounters(); clearEventCounters();
assertTrue("Did not stop because of catchpoint, but stopped because of: " + assertTrue("Did not stop because of catchpoint, but stopped because of: " +
event.getClass().getCanonicalName(), event instanceof MIBreakpointHitEvent); event.getClass().getCanonicalName(), event instanceof MIBreakpointHitEvent);
} }
@ -822,7 +822,7 @@ public class MICatchpointsTest extends BaseTestCase {
public void removeCatchpoint_InvalidBreakpoint() throws Throwable { public void removeCatchpoint_InvalidBreakpoint() throws Throwable {
// set a catchpoint // set a catchpoint
IBreakpointDMContext bkptRef1 = setCatchpoint("throw", null, null); IBreakpointDMContext bkptRef1 = setCatchpoint("throw", null, null);
// Remove the installed breakpoint // Remove the installed breakpoint
clearEventCounters(); clearEventCounters();
removeBreakpoint(bkptRef1); removeBreakpoint(bkptRef1);
@ -834,7 +834,7 @@ public class MICatchpointsTest extends BaseTestCase {
assertEquals("Unexpected number of breakpoint-added events", 1, getBreakpointEventCount(BP_REMOVED)); assertEquals("Unexpected number of breakpoint-added events", 1, getBreakpointEventCount(BP_REMOVED));
clearEventCounters(); clearEventCounters();
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 0, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 0, breakpoints.length);
@ -848,7 +848,7 @@ public class MICatchpointsTest extends BaseTestCase {
// Ensure no breakpoint events were received // Ensure no breakpoint events were received
assertEquals("Unexpected number of breakpoint events", 0, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 0, totalBreakpointEventsCount());
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
breakpoints = getBreakpoints(fBreakpointsDmc); breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 0, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 0, breakpoints.length);
@ -870,7 +870,7 @@ public class MICatchpointsTest extends BaseTestCase {
assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length);
MIBreakpointDMData bkpt2_set = (MIBreakpointDMData) getBreakpoint(bkptRef2); MIBreakpointDMData bkpt2_set = (MIBreakpointDMData) getBreakpoint(bkptRef2);
MIBreakpointDMData bkpt2_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]); MIBreakpointDMData bkpt2_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
assertEquals(bkpt2_set.getNumber(), bkpt2_svc.getNumber()); assertEquals(bkpt2_set.getNumber(), bkpt2_svc.getNumber());
} }
/** /**
@ -889,14 +889,14 @@ public class MICatchpointsTest extends BaseTestCase {
// Get the list of breakpoints // Get the list of breakpoints
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoint service reports unexpected number of breakpoints", events.length, breakpoints.length); assertEquals("Breakpoint service reports unexpected number of breakpoints", events.length, breakpoints.length);
// Remove the catchpoints one at a time but in an order different than how they were added // Remove the catchpoints one at a time but in an order different than how they were added
int[] whichOne = { 0, 2, 1, 3 }; int[] whichOne = { 0, 2, 1, 3 };
int breakpoints_left = 4; int breakpoints_left = 4;
for (int i = 0; i < whichOne.length; i++) { for (int i = 0; i < whichOne.length; i++) {
clearEventCounters(); clearEventCounters();
// Remove one of the catchpoints // Remove one of the catchpoints
IBreakpointDMContext removeThisBreakpoint = breakpoints[whichOne[i]]; IBreakpointDMContext removeThisBreakpoint = breakpoints[whichOne[i]];
removeBreakpoint(removeThisBreakpoint); removeBreakpoint(removeThisBreakpoint);
@ -907,8 +907,8 @@ public class MICatchpointsTest extends BaseTestCase {
waitForBreakpointEvent(1); waitForBreakpointEvent(1);
assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount());
assertEquals("Unexpected number of breakpoint-added events", 1, getBreakpointEventCount(BP_REMOVED)); assertEquals("Unexpected number of breakpoint-added events", 1, getBreakpointEventCount(BP_REMOVED));
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] remaining_breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] remaining_breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", --breakpoints_left, remaining_breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", --breakpoints_left, remaining_breakpoints.length);
for (int j = 0; j < breakpoints_left; j++) { for (int j = 0; j < breakpoints_left; j++) {
@ -953,20 +953,20 @@ public class MICatchpointsTest extends BaseTestCase {
if (runningOnWindows()) { if (runningOnWindows()) {
return; return;
} }
// Set a line breakpoint at the sleep() call. We need to get the program // Set a line breakpoint at the sleep() call. We need to get the program
// past the initial loop that throws and catches C++ exceptions. // past the initial loop that throws and catches C++ exceptions.
IBreakpointDMContext refLineBkpt = setLineBreakpoint(LINE_NUMBER_SLEEP_CALL); IBreakpointDMContext refLineBkpt = setLineBreakpoint(LINE_NUMBER_SLEEP_CALL);
// Run to the breakpoint // Run to the breakpoint
resumeAndExpectBkptHit(((MIBreakpointDMData) getBreakpoint(refLineBkpt)).getNumber(), null); resumeAndExpectBkptHit(((MIBreakpointDMData) getBreakpoint(refLineBkpt)).getNumber(), null);
// Set the two catchpoints // Set the two catchpoints
IBreakpointDMContext refThrow = setCatchpoint("throw", null, null); IBreakpointDMContext refThrow = setCatchpoint("throw", null, null);
IBreakpointDMContext refCatch = setCatchpoint("catch", null, null); IBreakpointDMContext refCatch = setCatchpoint("catch", null, null);
// Run the program. It will make a two second sleep() call, during which time... // Run the program. It will make a two second sleep() call, during which time...
clearEventCounters(); clearEventCounters();
SyncUtil.resume(); SyncUtil.resume();
// ...we remove one of the catchpoints // ...we remove one of the catchpoints
@ -980,10 +980,10 @@ public class MICatchpointsTest extends BaseTestCase {
MIStoppedEvent event = SyncUtil.waitForStop(3000); MIStoppedEvent event = SyncUtil.waitForStop(3000);
waitForBreakpointEvent(2); waitForBreakpointEvent(2);
assertTrue("stopped event is of an unexpected type: " + event.getClass().getName(), event instanceof MIBreakpointHitEvent); assertTrue("stopped event is of an unexpected type: " + event.getClass().getName(), event instanceof MIBreakpointHitEvent);
MIBreakpointHitEvent bkptHitEvent = (MIBreakpointHitEvent)event; MIBreakpointHitEvent bkptHitEvent = (MIBreakpointHitEvent)event;
MIBreakpointDMData bkptNotRemoved = (MIBreakpointDMData) getBreakpoint(removeThrow ? refCatch : refThrow); MIBreakpointDMData bkptNotRemoved = (MIBreakpointDMData) getBreakpoint(removeThrow ? refCatch : refThrow);
assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", bkptNotRemoved.getNumber(), bkptHitEvent.getNumber()); assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", bkptNotRemoved.getNumber(), bkptHitEvent.getNumber());
// If we removed the catch exception, we don't know at this point that // If we removed the catch exception, we don't know at this point that
// it won't get hit; we're stopped at the throw catchpoint. So resume // it won't get hit; we're stopped at the throw catchpoint. So resume
// the target and make sure it doesn't get hit. // the target and make sure it doesn't get hit.
@ -991,10 +991,10 @@ public class MICatchpointsTest extends BaseTestCase {
clearEventCounters(); clearEventCounters();
SyncUtil.resume(); SyncUtil.resume();
Thread.sleep(1000); // give the program a second to run to completion Thread.sleep(1000); // give the program a second to run to completion
assertEquals("Unexpected number of breakpoint events", 0, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 0, totalBreakpointEventsCount());
} }
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// Catchpoint Update tests // Catchpoint Update tests
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -1007,19 +1007,19 @@ public class MICatchpointsTest extends BaseTestCase {
public void updateCatchpoint_AddCondition() throws Throwable { public void updateCatchpoint_AddCondition() throws Throwable {
// Set a catchpoint with no condition // Set a catchpoint with no condition
IBreakpointDMContext ref = setCatchpoint("throw", null, null); IBreakpointDMContext ref = setCatchpoint("throw", null, null);
// Update the catchpoint to have a condition
modifyBkptProperty(ref, MIBreakpoints.CONDITION, CONDITION_1);
// Ensure the breakpoint service sees what we expect // Update the catchpoint to have a condition
modifyBkptProperty(ref, MIBreakpoints.CONDITION, CONDITION_1);
// Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length);
MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]); MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
assertEquals("Incorrect breakpoint condition", CONDITION_1, bkpt_svc.getCondition()); assertEquals("Incorrect breakpoint condition", CONDITION_1, bkpt_svc.getCondition());
resumeAndExpectBkptHit(bkpt_svc.getNumber(), 2); resumeAndExpectBkptHit(bkpt_svc.getNumber(), 2);
} }
/** /**
* Add a catchpoint with a condition then remove the condition * Add a catchpoint with a condition then remove the condition
*/ */
@ -1027,16 +1027,16 @@ public class MICatchpointsTest extends BaseTestCase {
public void updateCatchpoint_RemoveCondition() throws Throwable { public void updateCatchpoint_RemoveCondition() throws Throwable {
// Set a catchpoint with a condition // Set a catchpoint with a condition
IBreakpointDMContext ref = setCatchpoint("throw", CONDITION_1, null); IBreakpointDMContext ref = setCatchpoint("throw", CONDITION_1, null);
// Remove the condition // Remove the condition
modifyBkptProperty(ref, MIBreakpoints.CONDITION, null); modifyBkptProperty(ref, MIBreakpoints.CONDITION, null);
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length);
MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]); MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
assertEquals("Incorrect breakpoint condition", CONDITION_NONE, bkpt_svc.getCondition()); assertEquals("Incorrect breakpoint condition", CONDITION_NONE, bkpt_svc.getCondition());
resumeAndExpectBkptHit(bkpt_svc.getNumber(), 0); resumeAndExpectBkptHit(bkpt_svc.getNumber(), 0);
} }
@ -1051,7 +1051,7 @@ public class MICatchpointsTest extends BaseTestCase {
// Modify the catchpoint to have a different condition // Modify the catchpoint to have a different condition
modifyBkptProperty(ref, MIBreakpoints.CONDITION, CONDITION_2); modifyBkptProperty(ref, MIBreakpoints.CONDITION, CONDITION_2);
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length);
MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]); MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
@ -1066,7 +1066,7 @@ public class MICatchpointsTest extends BaseTestCase {
* through the loop that throws and catches C++ exceptions and then enter a * through the loop that throws and catches C++ exceptions and then enter a
* sleep call. During the sleep call, Then remove the throw catchpoint while * sleep call. During the sleep call, Then remove the throw catchpoint while
* the target is running and ensure the catch catchpoint is hit. * the target is running and ensure the catch catchpoint is hit.
* *
*/ */
@Test @Test
public void updateCatchpoint_WhileTargetRunning1() throws Throwable { public void updateCatchpoint_WhileTargetRunning1() throws Throwable {
@ -1093,7 +1093,7 @@ public class MICatchpointsTest extends BaseTestCase {
* to something that will resolve to true. After the sleep, the program does * to something that will resolve to true. After the sleep, the program does
* one more round of throwing and catching. Ensure that the target stops and * one more round of throwing and catching. Ensure that the target stops and
* that it's because of the catchpoint we updated. * that it's because of the catchpoint we updated.
* *
* @param removeThrow * @param removeThrow
* if true, we update the throw catchpoint, otherwise the catch * if true, we update the throw catchpoint, otherwise the catch
* one. * one.
@ -1108,8 +1108,8 @@ public class MICatchpointsTest extends BaseTestCase {
if (runningOnWindows()) { if (runningOnWindows()) {
return; return;
} }
// Set a line breakpoint at the sleep() call. // Set a line breakpoint at the sleep() call.
IBreakpointDMContext refLineBkpt = setLineBreakpoint(LINE_NUMBER_SLEEP_CALL); IBreakpointDMContext refLineBkpt = setLineBreakpoint(LINE_NUMBER_SLEEP_CALL);
// Set the two catchpoints // Set the two catchpoints
@ -1126,20 +1126,20 @@ public class MICatchpointsTest extends BaseTestCase {
MIBreakpointDMData lineBkpt = (MIBreakpointDMData) getBreakpoint(refLineBkpt); MIBreakpointDMData lineBkpt = (MIBreakpointDMData) getBreakpoint(refLineBkpt);
assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", lineBkpt.getNumber(), fBreakpointRef); assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", lineBkpt.getNumber(), fBreakpointRef);
clearEventCounters(); clearEventCounters();
// Resume the program. It will make a one second sleep() call, during which time... // Resume the program. It will make a one second sleep() call, during which time...
SyncUtil.resume(); SyncUtil.resume();
// ...we modify one of the catchpoints's condition // ...we modify one of the catchpoints's condition
modifyBkptProperty(modifyThrow ? refThrow : refCatch, MIBreakpoints.CONDITION, CONDITION_ALWAYS_MET); modifyBkptProperty(modifyThrow ? refThrow : refCatch, MIBreakpoints.CONDITION, CONDITION_ALWAYS_MET);
// After the sleep, the test app throws a C++ exception and catches it. // After the sleep, the test app throws a C++ exception and catches it.
// So, the catchpoint whose condition we modified should get hit // So, the catchpoint whose condition we modified should get hit
// Wait for breakpoint to hit and for the expected number of breakpoint events to have occurred // Wait for breakpoint to hit and for the expected number of breakpoint events to have occurred
MIStoppedEvent event = SyncUtil.waitForStop(3000); MIStoppedEvent event = SyncUtil.waitForStop(3000);
waitForBreakpointEvent(2); waitForBreakpointEvent(2);
assertTrue("stopped event is of an unexpected type: " + event.getClass().getName(), event instanceof MIBreakpointHitEvent); assertTrue("stopped event is of an unexpected type: " + event.getClass().getName(), event instanceof MIBreakpointHitEvent);
MIBreakpointHitEvent bkptHitEvent = (MIBreakpointHitEvent)event; MIBreakpointHitEvent bkptHitEvent = (MIBreakpointHitEvent)event;
MIBreakpointDMData bkptUpdated = (MIBreakpointDMData) getBreakpoint(modifyThrow ? refThrow : refCatch); MIBreakpointDMData bkptUpdated = (MIBreakpointDMData) getBreakpoint(modifyThrow ? refThrow : refCatch);
assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", bkptUpdated.getNumber(), bkptHitEvent.getNumber()); assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", bkptUpdated.getNumber(), bkptHitEvent.getNumber());
} }
@ -1152,12 +1152,12 @@ public class MICatchpointsTest extends BaseTestCase {
// Modify the catchpoint to have a different condition // Modify the catchpoint to have a different condition
modifyBkptProperty(ref, MIBreakpoints.IGNORE_COUNT, 3); modifyBkptProperty(ref, MIBreakpoints.IGNORE_COUNT, 3);
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length);
MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]); MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
assertEquals("Incorrect breakpoint condition", 3, bkpt_svc.getIgnoreCount()); assertEquals("Incorrect breakpoint condition", 3, bkpt_svc.getIgnoreCount());
// Resume and validate catchpoint hit // Resume and validate catchpoint hit
resumeAndExpectBkptHit(bkpt_svc.getNumber(), 3); resumeAndExpectBkptHit(bkpt_svc.getNumber(), 3);
} }
@ -1172,13 +1172,13 @@ public class MICatchpointsTest extends BaseTestCase {
// Modify the catchpoint to not have an ignore count // Modify the catchpoint to not have an ignore count
modifyBkptProperty(ref, MIBreakpoints.IGNORE_COUNT, null); modifyBkptProperty(ref, MIBreakpoints.IGNORE_COUNT, null);
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length);
MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]); MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
assertEquals("Incorrect breakpoint ignore count", 0, bkpt_svc.getIgnoreCount()); assertEquals("Incorrect breakpoint ignore count", 0, bkpt_svc.getIgnoreCount());
// Resume and validate catchpoint hit // Resume and validate catchpoint hit
resumeAndExpectBkptHit(bkpt_svc.getNumber(), 0); resumeAndExpectBkptHit(bkpt_svc.getNumber(), 0);
} }
@ -1195,7 +1195,7 @@ public class MICatchpointsTest extends BaseTestCase {
// Modify the catchpoint to have a different ignore count // Modify the catchpoint to have a different ignore count
modifyBkptProperty(ref, MIBreakpoints.IGNORE_COUNT, 5); modifyBkptProperty(ref, MIBreakpoints.IGNORE_COUNT, 5);
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 1, breakpoints.length);
MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]); MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
@ -1215,11 +1215,11 @@ public class MICatchpointsTest extends BaseTestCase {
// Set the catchpoints // Set the catchpoints
IBreakpointDMContext refThrow = setCatchpoint("throw", null, null); IBreakpointDMContext refThrow = setCatchpoint("throw", null, null);
IBreakpointDMContext refCatch = setCatchpoint("catch", null, null); IBreakpointDMContext refCatch = setCatchpoint("catch", null, null);
// Disable the throw catchpoint // Disable the throw catchpoint
modifyBkptProperty(refThrow, MIBreakpoints.IS_ENABLED, false); modifyBkptProperty(refThrow, MIBreakpoints.IS_ENABLED, false);
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 2, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 2, breakpoints.length);
int throwCatchpointNumber = ((MIBreakpointDMData)getBreakpoint(refThrow)).getNumber(); int throwCatchpointNumber = ((MIBreakpointDMData)getBreakpoint(refThrow)).getNumber();
@ -1231,11 +1231,11 @@ public class MICatchpointsTest extends BaseTestCase {
// Resume the target. Should miss the throw catchpoint and stop at the catch one // Resume the target. Should miss the throw catchpoint and stop at the catch one
int catchCatchpointNumber = ((MIBreakpointDMData)getBreakpoint(refCatch)).getNumber(); int catchCatchpointNumber = ((MIBreakpointDMData)getBreakpoint(refCatch)).getNumber();
resumeAndExpectBkptHit(catchCatchpointNumber, null); resumeAndExpectBkptHit(catchCatchpointNumber, null);
// Ee-enable the throw catchpoint // Ee-enable the throw catchpoint
modifyBkptProperty(refThrow, MIBreakpoints.IS_ENABLED, true); modifyBkptProperty(refThrow, MIBreakpoints.IS_ENABLED, true);
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
breakpoints = getBreakpoints(fBreakpointsDmc); breakpoints = getBreakpoints(fBreakpointsDmc);
assertEquals("Breakpoints service reports unexpected number of breakpoints", 2, breakpoints.length); assertEquals("Breakpoints service reports unexpected number of breakpoints", 2, breakpoints.length);
for (IBreakpointDMContext bkpt : breakpoints) { for (IBreakpointDMContext bkpt : breakpoints) {
@ -1263,7 +1263,7 @@ public class MICatchpointsTest extends BaseTestCase {
/** /**
* Set a line breakpoint and validate it was set correctly. * Set a line breakpoint and validate it was set correctly.
* *
* @param lineNumber * @param lineNumber
* the line where to set the breakpoint * the line where to set the breakpoint
* @return the breakpoint context * @return the breakpoint context
@ -1272,7 +1272,7 @@ public class MICatchpointsTest extends BaseTestCase {
clearEventCounters(); clearEventCounters();
IBreakpointDMContext[] bkptsBefore = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] bkptsBefore = getBreakpoints(fBreakpointsDmc);
// Set the breakpoint // Set the breakpoint
Map<String, Object> breakpoint = new HashMap<String, Object>(); Map<String, Object> breakpoint = new HashMap<String, Object>();
breakpoint.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); breakpoint.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT);
@ -1289,7 +1289,7 @@ public class MICatchpointsTest extends BaseTestCase {
// Ensure the breakpoint service sees what we expect // Ensure the breakpoint service sees what we expect
List<IBreakpointDMContext> bkptsAfter = new LinkedList<IBreakpointDMContext>(Arrays.asList(getBreakpoints(fBreakpointsDmc))); List<IBreakpointDMContext> bkptsAfter = new LinkedList<IBreakpointDMContext>(Arrays.asList(getBreakpoints(fBreakpointsDmc)));
assertEquals("Breakpoints service reports unexpected number of breakpoints", bkptsBefore.length + 1, bkptsAfter.size()); assertEquals("Breakpoints service reports unexpected number of breakpoints", bkptsBefore.length + 1, bkptsAfter.size());
ListIterator<IBreakpointDMContext> iter = bkptsAfter.listIterator(); ListIterator<IBreakpointDMContext> iter = bkptsAfter.listIterator();
while (iter.hasNext()) { while (iter.hasNext()) {
IBreakpointDMContext bkptAfter = iter.next(); IBreakpointDMContext bkptAfter = iter.next();
@ -1309,7 +1309,7 @@ public class MICatchpointsTest extends BaseTestCase {
/** /**
* Set a catchpoint for the given event and validate it was set correctly * Set a catchpoint for the given event and validate it was set correctly
* *
* @param event * @param event
* the event; the gdb keyword for it (e.g., "catch", "throw") * the event; the gdb keyword for it (e.g., "catch", "throw")
* @param condition * @param condition
@ -1322,7 +1322,7 @@ public class MICatchpointsTest extends BaseTestCase {
clearEventCounters(); clearEventCounters();
IBreakpointDMContext[] bkptsBefore = getBreakpoints(fBreakpointsDmc); IBreakpointDMContext[] bkptsBefore = getBreakpoints(fBreakpointsDmc);
// set the catchpoint // set the catchpoint
Map<String, Object> bkptsProps = new HashMap<String, Object>(); Map<String, Object> bkptsProps = new HashMap<String, Object>();
bkptsProps.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT); bkptsProps.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.CATCHPOINT);
@ -1335,7 +1335,7 @@ public class MICatchpointsTest extends BaseTestCase {
} }
IBreakpointDMContext refCatchpoint = insertBreakpoint(fBreakpointsDmc, bkptsProps); IBreakpointDMContext refCatchpoint = insertBreakpoint(fBreakpointsDmc, bkptsProps);
assertTrue(fWait.getMessage(), fWait.isOK()); assertTrue(fWait.getMessage(), fWait.isOK());
// Ensure that right breakpoint events were received. // Ensure that right breakpoint events were received.
waitForBreakpointEvent(1); waitForBreakpointEvent(1);
assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount());
@ -1359,11 +1359,11 @@ public class MICatchpointsTest extends BaseTestCase {
} }
} }
assertEquals("All but the new bkpt should have been removed from bkptsAfter", bkptsAfter.size(), 1); assertEquals("All but the new bkpt should have been removed from bkptsAfter", bkptsAfter.size(), 1);
MIBreakpointDMData bkpt_set = (MIBreakpointDMData) getBreakpoint(refCatchpoint); MIBreakpointDMData bkpt_set = (MIBreakpointDMData) getBreakpoint(refCatchpoint);
MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(bkptsAfter.get(0)); MIBreakpointDMData bkpt_svc = (MIBreakpointDMData) getBreakpoint(bkptsAfter.get(0));
assertEquals(bkpt_set.getNumber(), bkpt_svc.getNumber()); assertEquals(bkpt_set.getNumber(), bkpt_svc.getNumber());
assertEquals("Incorrect breakpoint condition", condition != null ? condition : CONDITION_NONE, bkpt_svc.getCondition()); assertEquals("Incorrect breakpoint condition", condition != null ? condition : CONDITION_NONE, bkpt_svc.getCondition());
assertEquals("Incorrect breakpoint ignore count", ignoreCount != null ? ignoreCount : 0, bkpt_svc.getIgnoreCount()); assertEquals("Incorrect breakpoint ignore count", ignoreCount != null ? ignoreCount : 0, bkpt_svc.getIgnoreCount());
@ -1374,7 +1374,7 @@ public class MICatchpointsTest extends BaseTestCase {
* Resume the target and expect it to be stopped by the given breakpoint. * Resume the target and expect it to be stopped by the given breakpoint.
* Optionally, check that the program's single global int variable has the * Optionally, check that the program's single global int variable has the
* given value. * given value.
* *
* @param bkptNumber * @param bkptNumber
* the GDB breakpoint number * the GDB breakpoint number
* @param expectedVarValue * @param expectedVarValue
@ -1383,7 +1383,7 @@ public class MICatchpointsTest extends BaseTestCase {
* @return the stoppped event * @return the stoppped event
*/ */
private MIStoppedEvent resumeAndExpectBkptHit(int bkptNumber, Integer expectedVarValue) throws Throwable { private MIStoppedEvent resumeAndExpectBkptHit(int bkptNumber, Integer expectedVarValue) throws Throwable {
// Resume the target. The throw catchpoint should get hit. // Resume the target. The throw catchpoint should get hit.
clearEventCounters(); clearEventCounters();
MIStoppedEvent event = SyncUtil.resumeUntilStopped(); MIStoppedEvent event = SyncUtil.resumeUntilStopped();
@ -1391,10 +1391,10 @@ public class MICatchpointsTest extends BaseTestCase {
waitForBreakpointEvent(1); waitForBreakpointEvent(1);
assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount());
assertEquals("Unexpected type of breakpoint event", 1, getBreakpointEventCount(BP_HIT)); assertEquals("Unexpected type of breakpoint event", 1, getBreakpointEventCount(BP_HIT));
// Ensure the target stopped because of the throw catchpoint // Ensure the target stopped because of the throw catchpoint
assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", bkptNumber, fBreakpointRef); assertEquals("Target stopped as expected, but the responsible breakpoint was not the expected one", bkptNumber, fBreakpointRef);
if (expectedVarValue != null) { if (expectedVarValue != null) {
IFrameDMContext frameDmc = SyncUtil.getStackFrame(event.getDMContext(), 0); IFrameDMContext frameDmc = SyncUtil.getStackFrame(event.getDMContext(), 0);
assertEquals("program variable has unexpected value", expectedVarValue.intValue(), evaluateExpression(frameDmc, CONDITION_VAR).intValue()); assertEquals("program variable has unexpected value", expectedVarValue.intValue(), evaluateExpression(frameDmc, CONDITION_VAR).intValue());
@ -1413,11 +1413,11 @@ public class MICatchpointsTest extends BaseTestCase {
bkptProps.put(property, value); bkptProps.put(property, value);
updateBreakpoint(bkptRef, bkptProps); updateBreakpoint(bkptRef, bkptProps);
assertTrue(fWait.getMessage(), fWait.isOK()); assertTrue(fWait.getMessage(), fWait.isOK());
// Ensure that right breakpoint events were received // Ensure that right breakpoint events were received
waitForBreakpointEvent(1); waitForBreakpointEvent(1);
assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount()); assertEquals("Unexpected number of breakpoint events", 1, totalBreakpointEventsCount());
assertEquals("Unexpected number of breakpoint added events", 1, getBreakpointEventCount(BP_UPDATED)); assertEquals("Unexpected number of breakpoint added events", 1, getBreakpointEventCount(BP_UPDATED));
} }
} }

View file

@ -0,0 +1,86 @@
/*******************************************************************************
* Copyright (c) 2016 QNX Software System and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Elena Laskavaia (QNX Software System) - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseParametrizedTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.CommandTimeoutTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.GDBConsoleBreakpointsTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.GDBConsoleSynchronizingTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.GDBMultiNonStopRunControlTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.GDBPatternMatchingExpressionsTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.GDBProcessesTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.LaunchConfigurationAndRestartTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MICatchpointsTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIDisassemblyTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIExpressionsNonStopTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIExpressionsTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIMemoryTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIRegistersTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIRunControlNonStopTargetAvailableTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIRunControlTargetAvailableTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.MIRunControlTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.OperationsWhileTargetIsRunningNonStopTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.OperationsWhileTargetIsRunningTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.PostMortemCoreTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.SourceLookupTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.StepIntoSelectionNonStopTest_7_11;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11.StepIntoSelectionTest_7_11;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* This suite is for tests to be run with GDB.
*
* If you running this from IDE use java var to control version like this -Dcdt.tests.dsf.gdb.versions=gdb.7.7,gdbserver.7.7
* If you don't it will run default gdb (without version postfix) for new tests. It will run 7.11 for all non-converted tests.
*
* If you adding a new test class do not use gdb version naming. Use flat version extending BaseParametrizedTestCase,
* see {@link MIBreakpointsTest}
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
// temporary we still use hardcoded gdb version name, we will slowly flatten them
MIRegistersTest_7_11.class,
MIRunControlTest_7_11.class,
MIRunControlTargetAvailableTest_7_11.class,
MIRunControlNonStopTargetAvailableTest_7_11.class,
MIExpressionsTest_7_11.class,
MIExpressionsNonStopTest_7_11.class,
GDBPatternMatchingExpressionsTest_7_11.class,
MIMemoryTest_7_11.class,
MIBreakpointsTest.class, // this is flat version
MICatchpointsTest_7_11.class,
MIDisassemblyTest_7_11.class,
GDBProcessesTest_7_11.class,
LaunchConfigurationAndRestartTest_7_11.class,
OperationsWhileTargetIsRunningTest_7_11.class,
OperationsWhileTargetIsRunningNonStopTest_7_11.class,
PostMortemCoreTest_7_11.class,
CommandTimeoutTest_7_11.class,
GDBMultiNonStopRunControlTest_7_11.class,
GDBConsoleBreakpointsTest_7_11.class,
GDBConsoleSynchronizingTest_7_11.class,
StepIntoSelectionTest_7_11.class,
StepIntoSelectionNonStopTest_7_11.class,
SourceLookupTest_7_11.class,
/* Add your test class here */
})
public class SuiteGdb {
@BeforeClass
public static void before() {
// If we running this suite we have to clean up global options since
// each test will set local version of these properly.
// If our tests are running from other suites they
// may have globals that will override local values.
BaseParametrizedTestCase.resetGlobalState();
}
}

View file

@ -1,36 +0,0 @@
/*******************************************************************************
* Copyright (c) 2009, 2015 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_6_6 extends MIBreakpointsTest {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_6);
}
// Currently, this test uses breakpoint synchronization with
// the gdb console which is only available with GDB 7.4
// So we mark it with @Ignore
@Override
@Ignore
@Test
public void updateBreakpoint_AfterRestart() throws Throwable {
super.updateBreakpoint_AfterRestart();
}
}

View file

@ -14,6 +14,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -36,7 +37,7 @@ import org.junit.runners.Suite;
MIExpressionsTest_6_6.class, MIExpressionsTest_6_6.class,
GDBPatternMatchingExpressionsTest_6_6.class, GDBPatternMatchingExpressionsTest_6_6.class,
MIMemoryTest_6_6.class, MIMemoryTest_6_6.class,
MIBreakpointsTest_6_6.class, MIBreakpointsTest.class,
MICatchpointsTest_6_6.class, MICatchpointsTest_6_6.class,
MIDisassemblyTest_6_6.class, MIDisassemblyTest_6_6.class,
GDBProcessesTest_6_6.class, GDBProcessesTest_6_6.class,

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -37,7 +38,7 @@ import org.junit.runners.Suite;
MIExpressionsTest_6_6.class, MIExpressionsTest_6_6.class,
GDBPatternMatchingExpressionsTest_6_6.class, GDBPatternMatchingExpressionsTest_6_6.class,
MIMemoryTest_6_6.class, MIMemoryTest_6_6.class,
MIBreakpointsTest_6_6.class, MIBreakpointsTest.class,
MICatchpointsTest_6_6.class, MICatchpointsTest_6_6.class,
MIDisassemblyTest_6_6.class, MIDisassemblyTest_6_6.class,
GDBProcessesTest_6_6.class, GDBProcessesTest_6_6.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2009, 2012 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6.MIBreakpointsTest_6_6;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_6_7 extends MIBreakpointsTest_6_6 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_7);
}
}

View file

@ -14,6 +14,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -36,7 +37,7 @@ import org.junit.runners.Suite;
MIExpressionsTest_6_7.class, MIExpressionsTest_6_7.class,
GDBPatternMatchingExpressionsTest_6_7.class, GDBPatternMatchingExpressionsTest_6_7.class,
MIMemoryTest_6_7.class, MIMemoryTest_6_7.class,
MIBreakpointsTest_6_7.class, MIBreakpointsTest.class,
MICatchpointsTest_6_7.class, MICatchpointsTest_6_7.class,
MIDisassemblyTest_6_7.class, MIDisassemblyTest_6_7.class,
GDBProcessesTest_6_7.class, GDBProcessesTest_6_7.class,

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -37,7 +38,7 @@ import org.junit.runners.Suite;
MIExpressionsTest_6_7.class, MIExpressionsTest_6_7.class,
GDBPatternMatchingExpressionsTest_6_7.class, GDBPatternMatchingExpressionsTest_6_7.class,
MIMemoryTest_6_7.class, MIMemoryTest_6_7.class,
MIBreakpointsTest_6_7.class, MIBreakpointsTest.class,
MICatchpointsTest_6_7.class, MICatchpointsTest_6_7.class,
MIDisassemblyTest_6_7.class, MIDisassemblyTest_6_7.class,
GDBProcessesTest_6_7.class, GDBProcessesTest_6_7.class,

View file

@ -1,192 +0,0 @@
/*******************************************************************************
* Copyright (c) 2009, 2015 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
* Simon Marchi (Ericsson) - Add and use runningOnWindows().
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointDMContext;
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData;
import org.eclipse.cdt.dsf.mi.service.MIBreakpoints.MIBreakpointDMContext;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.framework.SyncUtil;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7.MIBreakpointsTest_6_7;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_6_8 extends MIBreakpointsTest_6_7 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_8);
}
// GDB 6.8 has a bug that ignores watchpoint conditions,which makes this
// test fail. We therefore ignore this test for GDB 6.8 only, but run it
// for all other versions
@Override
@Ignore("This test does not work with GDB 6.8")
@Test
public void breakpointHit_watchpointUpdateCondition() throws Throwable {
// Must call the test in the super class to allow further derived
// classes to run this test.
super.breakpointHit_watchpointUpdateCondition();
}
/**
* Starting with GDB 6.8, we request failed breakpoints to be pending in
* GDB. So we no longer get an installation error from GDB.
*/
@Override
@Test
public void insertBreakpoint_InvalidFileName() throws Throwable {
// Create an invalid line breakpoint
Map<String, Object> breakpoint = new HashMap<String, Object>();
breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG);
breakpoint.put(FILE_NAME_TAG, SOURCE_NAME + "_bad");
breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1);
// Perform the test, which we still expect to succeed
// giving us a pending breakpoint
IBreakpointDMContext ref = insertBreakpoint(fBreakpointsDmc, breakpoint);
assertTrue(fWait.getMessage(), fWait.isOK());
// Ensure that right BreakpointEvents were received
waitForBreakpointEvent(1);
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
+ fBreakpointEventCount, fBreakpointEventCount == 1);
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
clearEventCounters();
// Ensure that the breakpoint was correctly installed
MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)",
breakpoint1.getFileName().equals(""));
assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)",
breakpoint1.getLineNumber() == -1);
assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)",
breakpoint1.getCondition().equals(NO_CONDITION));
assertTrue("BreakpointService problem: breakpoint mismatch (wrong ignore count)",
breakpoint1.getIgnoreCount() == 0);
assertTrue("BreakpointService problem: breakpoint mismatch (wrong state)",
breakpoint1.isEnabled());
assertTrue("BreakpointService problem: breakpoint mismatch (not pending)",
breakpoint1.isPending());
// Ensure the BreakpointService holds only the right breakpoints
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertTrue("BreakpointService problem: expected " + 1 + " breakpoint(s), received "
+ breakpoints.length, breakpoints.length == 1);
MIBreakpointDMData breakpoint2 = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
assertTrue("BreakpointService problem: breakpoint mismatch",
breakpoint1.equals(breakpoint2));
}
/**
* Starting with GDB 6.8, we request failed breakpoints to be pending in
* GDB. So we no longer get an installation error from GDB.
*/
@Override
@Test
public void insertBreakpoint_InvalidFunctionName() throws Throwable {
// Create an invalid function breakpoint
Map<String, Object> breakpoint = new HashMap<String, Object>();
breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG);
breakpoint.put(FILE_NAME_TAG, SOURCE_NAME);
breakpoint.put(FUNCTION_TAG, "invalid-function-name");
// Perform the test, which we still expect to succeed
// giving us a pending breakpoint
IBreakpointDMContext ref = insertBreakpoint(fBreakpointsDmc, breakpoint);
assertTrue(fWait.getMessage(), fWait.isOK());
// Ensure that right BreakpointEvents were received
waitForBreakpointEvent(1);
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
+ fBreakpointEventCount, fBreakpointEventCount == 1);
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
clearEventCounters();
// Ensure that the breakpoint was correctly installed
MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)",
breakpoint1.getFileName().equals(""));
assertTrue("BreakpointService problem: breakpoint mismatch (wrong function)",
breakpoint1.getFunctionName().equals(""));
assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)",
breakpoint1.getCondition().equals(NO_CONDITION));
assertTrue("BreakpointService problem: breakpoint mismatch (wrong ignore count)",
breakpoint1.getIgnoreCount() == 0);
assertTrue("BreakpointService problem: breakpoint mismatch (not pending)",
breakpoint1.isPending());
// Ensure the BreakpointService holds only the right breakpoints
IBreakpointDMContext[] breakpoints = getBreakpoints(fBreakpointsDmc);
assertTrue("BreakpointService problem: expected " + 1 + " breakpoint(s), received "
+ breakpoints.length, breakpoints.length == 1);
MIBreakpointDMData breakpoint2 = (MIBreakpointDMData) getBreakpoint(breakpoints[0]);
assertTrue("BreakpointService problem: breakpoint mismatch",
breakpoint1.equals(breakpoint2));
}
/**
* Starting with GDB 6.8, we request failed breakpoints to be pending in
* GDB. So we no longer get an installation error from GDB.
*/
@Override
@Test
public void insertInvalidBreakpoint_WhileTargetRunning() throws Throwable {
// Interrupting the target on Windows is susceptible to an additional,
// unwanted suspension. That means that silently interrupting the target
// to set/modify/remove a breakpoint then resuming it can leave the
// target in a suspended state. Unfortunately, there is nothing
// practical CDT can do to address this issue except wait for the gdb
// folks to resolve it. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=304096#c27
if (runningOnWindows()) {
return;
}
// Create an invalid line breakpoint
Map<String, Object> breakpoint = new HashMap<String, Object>();
breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG);
breakpoint.put(FILE_NAME_TAG, "Bad file name");
breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5);
// Run the program. It will make a two second sleep() call, during which time...
SyncUtil.resume();
// ...we install the breakpoint
MIBreakpointDMContext ref = (MIBreakpointDMContext) insertBreakpoint(fBreakpointsDmc, breakpoint);
assertTrue(fWait.getMessage(), fWait.isOK());
waitForBreakpointEvent(1);
// Ensure the correct BreakpointEvent was received
MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
+ fBreakpointEventCount, fBreakpointEventCount == 1);
assertTrue("BreakpointEvent problem: expected " + 0 + " BREAKPOINT_HIT event(s), received "
+ getBreakpointEventCount(BP_HIT), getBreakpointEventCount(BP_HIT) == 0);
assertTrue("BreakpointService problem: breakpoint mismatch",
fBreakpointRef == breakpoint1.getNumber());
assertTrue("BreakpointService problem: breakpoint mismatch (not pending)",
breakpoint1.isPending());
clearEventCounters();
}
}

View file

@ -14,6 +14,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -36,7 +37,7 @@ import org.junit.runners.Suite;
MIExpressionsTest_6_8.class, MIExpressionsTest_6_8.class,
GDBPatternMatchingExpressionsTest_6_8.class, GDBPatternMatchingExpressionsTest_6_8.class,
MIMemoryTest_6_8.class, MIMemoryTest_6_8.class,
MIBreakpointsTest_6_8.class, MIBreakpointsTest.class,
MICatchpointsTest_6_8.class, MICatchpointsTest_6_8.class,
MIDisassemblyTest_6_8.class, MIDisassemblyTest_6_8.class,
GDBProcessesTest_6_8.class, GDBProcessesTest_6_8.class,

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -37,7 +38,7 @@ import org.junit.runners.Suite;
MIExpressionsTest_6_8.class, MIExpressionsTest_6_8.class,
GDBPatternMatchingExpressionsTest_6_8.class, GDBPatternMatchingExpressionsTest_6_8.class,
MIMemoryTest_6_8.class, MIMemoryTest_6_8.class,
MIBreakpointsTest_6_8.class, MIBreakpointsTest.class,
MICatchpointsTest_6_8.class, MICatchpointsTest_6_8.class,
MIDisassemblyTest_6_8.class, MIDisassemblyTest_6_8.class,
GDBProcessesTest_6_8.class, GDBProcessesTest_6_8.class,

View file

@ -1,35 +0,0 @@
/*******************************************************************************
* Copyright (c) 2009, 2012 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8.MIBreakpointsTest_6_8;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_0 extends MIBreakpointsTest_6_8 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_0);
}
// GDB 6.8 has a bug that ignores watchpoint conditions,which makes this
// test fail. We therefore ignore this test for GDB 6.8 only, but run it
// for all other versions, so the code below re-enables the test starting
// with GDB 7.0.
@Override
@Test
public void breakpointHit_watchpointUpdateCondition() throws Throwable {
super.breakpointHit_watchpointUpdateCondition();
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_0.class, MIExpressionsNonStopTest_7_0.class,
GDBPatternMatchingExpressionsTest_7_0.class, GDBPatternMatchingExpressionsTest_7_0.class,
MIMemoryTest_7_0.class, MIMemoryTest_7_0.class,
MIBreakpointsTest_7_0.class, MIBreakpointsTest.class,
MICatchpointsTest_7_0.class, MICatchpointsTest_7_0.class,
MIDisassemblyTest_7_0.class, MIDisassemblyTest_7_0.class,
GDBProcessesTest_7_0.class, GDBProcessesTest_7_0.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_0.class, MIExpressionsNonStopTest_7_0.class,
GDBPatternMatchingExpressionsTest_7_0.class, GDBPatternMatchingExpressionsTest_7_0.class,
MIMemoryTest_7_0.class, MIMemoryTest_7_0.class,
MIBreakpointsTest_7_0.class, MIBreakpointsTest.class,
MICatchpointsTest_7_0.class, MICatchpointsTest_7_0.class,
MIDisassemblyTest_7_0.class, MIDisassemblyTest_7_0.class,
GDBProcessesTest_7_0.class, GDBProcessesTest_7_0.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2010, 2012 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0.MIBreakpointsTest_7_0;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_1 extends MIBreakpointsTest_7_0 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_1);
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_1.class, MIExpressionsNonStopTest_7_1.class,
GDBPatternMatchingExpressionsTest_7_1.class, GDBPatternMatchingExpressionsTest_7_1.class,
MIMemoryTest_7_1.class, MIMemoryTest_7_1.class,
MIBreakpointsTest_7_1.class, MIBreakpointsTest.class,
MICatchpointsTest_7_1.class, MICatchpointsTest_7_1.class,
MIDisassemblyTest_7_1.class, MIDisassemblyTest_7_1.class,
GDBProcessesTest_7_1.class, GDBProcessesTest_7_1.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_1.class, MIExpressionsNonStopTest_7_1.class,
GDBPatternMatchingExpressionsTest_7_1.class, GDBPatternMatchingExpressionsTest_7_1.class,
MIMemoryTest_7_1.class, MIMemoryTest_7_1.class,
MIBreakpointsTest_7_1.class, MIBreakpointsTest.class,
MICatchpointsTest_7_1.class, MICatchpointsTest_7_1.class,
MIDisassemblyTest_7_1.class, MIDisassemblyTest_7_1.class,
GDBProcessesTest_7_1.class, GDBProcessesTest_7_1.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_10;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_9.MIBreakpointsTest_7_9;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_10 extends MIBreakpointsTest_7_9 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_10);
}
}

View file

@ -14,6 +14,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_10;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -38,7 +39,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_10.class, MIExpressionsNonStopTest_7_10.class,
GDBPatternMatchingExpressionsTest_7_10.class, GDBPatternMatchingExpressionsTest_7_10.class,
MIMemoryTest_7_10.class, MIMemoryTest_7_10.class,
MIBreakpointsTest_7_10.class, MIBreakpointsTest.class,
MICatchpointsTest_7_10.class, MICatchpointsTest_7_10.class,
MIDisassemblyTest_7_10.class, MIDisassemblyTest_7_10.class,
GDBProcessesTest_7_10.class, GDBProcessesTest_7_10.class,

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_10;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_10.class, MIExpressionsNonStopTest_7_10.class,
GDBPatternMatchingExpressionsTest_7_10.class, GDBPatternMatchingExpressionsTest_7_10.class,
MIMemoryTest_7_10.class, MIMemoryTest_7_10.class,
MIBreakpointsTest_7_10.class, MIBreakpointsTest.class,
MICatchpointsTest_7_10.class, MICatchpointsTest_7_10.class,
MIDisassemblyTest_7_10.class, MIDisassemblyTest_7_10.class,
GDBProcessesTest_7_10.class, GDBProcessesTest_7_10.class,

View file

@ -1,21 +0,0 @@
/*******************************************************************************
* Copyright (c) 2015 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_10.MIBreakpointsTest_7_10;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_11 extends MIBreakpointsTest_7_10 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_11);
}
}

View file

@ -9,6 +9,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -33,7 +34,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_11.class, MIExpressionsNonStopTest_7_11.class,
GDBPatternMatchingExpressionsTest_7_11.class, GDBPatternMatchingExpressionsTest_7_11.class,
MIMemoryTest_7_11.class, MIMemoryTest_7_11.class,
MIBreakpointsTest_7_11.class, MIBreakpointsTest.class,
MICatchpointsTest_7_11.class, MICatchpointsTest_7_11.class,
MIDisassemblyTest_7_11.class, MIDisassemblyTest_7_11.class,
GDBProcessesTest_7_11.class, GDBProcessesTest_7_11.class,

View file

@ -10,6 +10,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_11;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -36,7 +37,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_11.class, MIExpressionsNonStopTest_7_11.class,
GDBPatternMatchingExpressionsTest_7_11.class, GDBPatternMatchingExpressionsTest_7_11.class,
MIMemoryTest_7_11.class, MIMemoryTest_7_11.class,
MIBreakpointsTest_7_11.class, MIBreakpointsTest.class,
MICatchpointsTest_7_11.class, MICatchpointsTest_7_11.class,
MIDisassemblyTest_7_11.class, MIDisassemblyTest_7_11.class,
GDBProcessesTest_7_11.class, GDBProcessesTest_7_11.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2010, 2012 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1.MIBreakpointsTest_7_1;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_2 extends MIBreakpointsTest_7_1 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_2);
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_2.class, MIExpressionsNonStopTest_7_2.class,
GDBPatternMatchingExpressionsTest_7_2.class, GDBPatternMatchingExpressionsTest_7_2.class,
MIMemoryTest_7_2.class, MIMemoryTest_7_2.class,
MIBreakpointsTest_7_2.class, MIBreakpointsTest.class,
MICatchpointsTest_7_2.class, MICatchpointsTest_7_2.class,
MIDisassemblyTest_7_2.class, MIDisassemblyTest_7_2.class,
GDBProcessesTest_7_2.class, GDBProcessesTest_7_2.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_2.class, MIExpressionsNonStopTest_7_2.class,
GDBPatternMatchingExpressionsTest_7_2.class, GDBPatternMatchingExpressionsTest_7_2.class,
MIMemoryTest_7_2.class, MIMemoryTest_7_2.class,
MIBreakpointsTest_7_2.class, MIBreakpointsTest.class,
MICatchpointsTest_7_2.class, MICatchpointsTest_7_2.class,
MIDisassemblyTest_7_2.class, MIDisassemblyTest_7_2.class,
GDBProcessesTest_7_2.class, GDBProcessesTest_7_2.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2011, 2012 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2.MIBreakpointsTest_7_2;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_3 extends MIBreakpointsTest_7_2 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_3);
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_3.class, MIExpressionsNonStopTest_7_3.class,
GDBPatternMatchingExpressionsTest_7_3.class, GDBPatternMatchingExpressionsTest_7_3.class,
MIMemoryTest_7_3.class, MIMemoryTest_7_3.class,
MIBreakpointsTest_7_3.class, MIBreakpointsTest.class,
MICatchpointsTest_7_3.class, MICatchpointsTest_7_3.class,
MIDisassemblyTest_7_3.class, MIDisassemblyTest_7_3.class,
GDBProcessesTest_7_3.class, GDBProcessesTest_7_3.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_3.class, MIExpressionsNonStopTest_7_3.class,
GDBPatternMatchingExpressionsTest_7_3.class, GDBPatternMatchingExpressionsTest_7_3.class,
MIMemoryTest_7_3.class, MIMemoryTest_7_3.class,
MIBreakpointsTest_7_3.class, MIBreakpointsTest.class,
MICatchpointsTest_7_3.class, MICatchpointsTest_7_3.class,
MIDisassemblyTest_7_3.class, MIDisassemblyTest_7_3.class,
GDBProcessesTest_7_3.class, GDBProcessesTest_7_3.class,

View file

@ -1,75 +0,0 @@
/*******************************************************************************
* Copyright (c) 2012, 2015 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4;
import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointDMContext;
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3.MIBreakpointsTest_7_3;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_4 extends MIBreakpointsTest_7_3 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_4);
}
/*
* Starting with GDB 7.4, breakpoints at invalid lines succeed and become
* pending breakpoints. This is because the invalid line for one file,
* may be valid for another file with the same name.
* One could argue that line 0 is an exception, but GDB does not make
* a difference.
* @see org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest#insertBreakpoint_InvalidLineNumber()
*/
@Override
@Test
public void insertBreakpoint_InvalidLineNumber() throws Throwable {
// Create a line breakpoint
Map<String, Object> breakpoint = new HashMap<String, Object>();
breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG);
breakpoint.put(FILE_NAME_TAG, SOURCE_NAME);
breakpoint.put(LINE_NUMBER_TAG, 0);
// Perform the test
IBreakpointDMContext ref = insertBreakpoint(fBreakpointsDmc, breakpoint);
assertTrue(fWait.getMessage(), fWait.isOK());
// Ensure that no BreakpointEvent was received
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
+ fBreakpointEventCount, fBreakpointEventCount == 1);
MIBreakpointDMData bpData = (MIBreakpointDMData) getBreakpoint(ref);
assertTrue("Breakpoint should be pending", bpData.isPending());
assertTrue("Breakpoint mismatch should be enabled", bpData.isEnabled());
}
// Re-enabled this test since it needs breakpoint synchronization
// with the gdb console, which is available starting with GDB 7.4
// We still leave the test in the base class MIBreakpointsTest because
// the test could be written differently and made to work for older
// gdb versions
@Override
@Test
public void updateBreakpoint_AfterRestart() throws Throwable {
super.updateBreakpoint_AfterRestart();
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_4.class, MIExpressionsNonStopTest_7_4.class,
GDBPatternMatchingExpressionsTest_7_4.class, GDBPatternMatchingExpressionsTest_7_4.class,
MIMemoryTest_7_4.class, MIMemoryTest_7_4.class,
MIBreakpointsTest_7_4.class, MIBreakpointsTest.class,
MICatchpointsTest_7_4.class, MICatchpointsTest_7_4.class,
MIDisassemblyTest_7_4.class, MIDisassemblyTest_7_4.class,
GDBProcessesTest_7_4.class, GDBProcessesTest_7_4.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_4.class, MIExpressionsNonStopTest_7_4.class,
GDBPatternMatchingExpressionsTest_7_4.class, GDBPatternMatchingExpressionsTest_7_4.class,
MIMemoryTest_7_4.class, MIMemoryTest_7_4.class,
MIBreakpointsTest_7_4.class, MIBreakpointsTest.class,
MICatchpointsTest_7_4.class, MICatchpointsTest_7_4.class,
MIDisassemblyTest_7_4.class, MIDisassemblyTest_7_4.class,
GDBProcessesTest_7_4.class, GDBProcessesTest_7_4.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2012 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4.MIBreakpointsTest_7_4;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_5 extends MIBreakpointsTest_7_4 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_5);
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -40,7 +41,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_5.class, MIExpressionsNonStopTest_7_5.class,
GDBPatternMatchingExpressionsTest_7_5.class, GDBPatternMatchingExpressionsTest_7_5.class,
MIMemoryTest_7_5.class, MIMemoryTest_7_5.class,
MIBreakpointsTest_7_5.class, MIBreakpointsTest.class,
MICatchpointsTest_7_5.class, MICatchpointsTest_7_5.class,
MIDisassemblyTest_7_5.class, MIDisassemblyTest_7_5.class,
GDBProcessesTest_7_5.class, GDBProcessesTest_7_5.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_5.class, MIExpressionsNonStopTest_7_5.class,
GDBPatternMatchingExpressionsTest_7_5.class, GDBPatternMatchingExpressionsTest_7_5.class,
MIMemoryTest_7_5.class, MIMemoryTest_7_5.class,
MIBreakpointsTest_7_5.class, MIBreakpointsTest.class,
MICatchpointsTest_7_5.class, MICatchpointsTest_7_5.class,
MIDisassemblyTest_7_5.class, MIDisassemblyTest_7_5.class,
GDBProcessesTest_7_5.class, GDBProcessesTest_7_5.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2012, 2013 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_5.MIBreakpointsTest_7_5;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_6 extends MIBreakpointsTest_7_5 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_6);
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_6.class, MIExpressionsNonStopTest_7_6.class,
GDBPatternMatchingExpressionsTest_7_6.class, GDBPatternMatchingExpressionsTest_7_6.class,
MIMemoryTest_7_6.class, MIMemoryTest_7_6.class,
MIBreakpointsTest_7_6.class, MIBreakpointsTest.class,
MICatchpointsTest_7_6.class, MICatchpointsTest_7_6.class,
MIDisassemblyTest_7_6.class, MIDisassemblyTest_7_6.class,
GDBProcessesTest_7_6.class, GDBProcessesTest_7_6.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -42,7 +43,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_6.class, MIExpressionsNonStopTest_7_6.class,
GDBPatternMatchingExpressionsTest_7_6.class, GDBPatternMatchingExpressionsTest_7_6.class,
MIMemoryTest_7_6.class, MIMemoryTest_7_6.class,
MIBreakpointsTest_7_6.class, MIBreakpointsTest.class,
MICatchpointsTest_7_6.class, MICatchpointsTest_7_6.class,
MIDisassemblyTest_7_6.class, MIDisassemblyTest_7_6.class,
GDBProcessesTest_7_6.class, GDBProcessesTest_7_6.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_7;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_6.MIBreakpointsTest_7_6;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_7 extends MIBreakpointsTest_7_6 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_7);
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_7;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_7.class, MIExpressionsNonStopTest_7_7.class,
GDBPatternMatchingExpressionsTest_7_7.class, GDBPatternMatchingExpressionsTest_7_7.class,
MIMemoryTest_7_7.class, MIMemoryTest_7_7.class,
MIBreakpointsTest_7_7.class, MIBreakpointsTest.class,
MICatchpointsTest_7_7.class, MICatchpointsTest_7_7.class,
MIDisassemblyTest_7_7.class, MIDisassemblyTest_7_7.class,
GDBProcessesTest_7_7.class, GDBProcessesTest_7_7.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_7;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -42,7 +43,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_7.class, MIExpressionsNonStopTest_7_7.class,
GDBPatternMatchingExpressionsTest_7_7.class, GDBPatternMatchingExpressionsTest_7_7.class,
MIMemoryTest_7_7.class, MIMemoryTest_7_7.class,
MIBreakpointsTest_7_7.class, MIBreakpointsTest.class,
MICatchpointsTest_7_7.class, MICatchpointsTest_7_7.class,
MIDisassemblyTest_7_7.class, MIDisassemblyTest_7_7.class,
GDBProcessesTest_7_7.class, GDBProcessesTest_7_7.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_8;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_7.MIBreakpointsTest_7_7;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_8 extends MIBreakpointsTest_7_7 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_8);
}
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_8;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -39,7 +40,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_8.class, MIExpressionsNonStopTest_7_8.class,
GDBPatternMatchingExpressionsTest_7_8.class, GDBPatternMatchingExpressionsTest_7_8.class,
MIMemoryTest_7_8.class, MIMemoryTest_7_8.class,
MIBreakpointsTest_7_8.class, MIBreakpointsTest.class,
MICatchpointsTest_7_8.class, MICatchpointsTest_7_8.class,
MIDisassemblyTest_7_8.class, MIDisassemblyTest_7_8.class,
GDBProcessesTest_7_8.class, GDBProcessesTest_7_8.class,

View file

@ -16,6 +16,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_8;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -42,7 +43,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_8.class, MIExpressionsNonStopTest_7_8.class,
GDBPatternMatchingExpressionsTest_7_8.class, GDBPatternMatchingExpressionsTest_7_8.class,
MIMemoryTest_7_8.class, MIMemoryTest_7_8.class,
MIBreakpointsTest_7_8.class, MIBreakpointsTest.class,
MICatchpointsTest_7_8.class, MICatchpointsTest_7_8.class,
MIDisassemblyTest_7_8.class, MIDisassemblyTest_7_8.class,
GDBProcessesTest_7_8.class, GDBProcessesTest_7_8.class,

View file

@ -1,24 +0,0 @@
/*******************************************************************************
* Copyright (c) 2014 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Marc Khouzam (Ericsson) - Initial implementation of Test cases
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_9;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_8.MIBreakpointsTest_7_8;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
public class MIBreakpointsTest_7_9 extends MIBreakpointsTest_7_8 {
@Override
protected void setGdbVersion() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_9);
}
}

View file

@ -14,6 +14,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_9;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -38,7 +39,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_9.class, MIExpressionsNonStopTest_7_9.class,
GDBPatternMatchingExpressionsTest_7_9.class, GDBPatternMatchingExpressionsTest_7_9.class,
MIMemoryTest_7_9.class, MIMemoryTest_7_9.class,
MIBreakpointsTest_7_9.class, MIBreakpointsTest.class,
MICatchpointsTest_7_9.class, MICatchpointsTest_7_9.class,
MIDisassemblyTest_7_9.class, MIDisassemblyTest_7_9.class,
GDBProcessesTest_7_9.class, GDBProcessesTest_7_9.class,

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_9;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseRemoteSuite;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
@ -41,7 +42,7 @@ import org.junit.runners.Suite;
MIExpressionsNonStopTest_7_9.class, MIExpressionsNonStopTest_7_9.class,
GDBPatternMatchingExpressionsTest_7_9.class, GDBPatternMatchingExpressionsTest_7_9.class,
MIMemoryTest_7_9.class, MIMemoryTest_7_9.class,
MIBreakpointsTest_7_9.class, MIBreakpointsTest.class,
MICatchpointsTest_7_9.class, MICatchpointsTest_7_9.class,
MIDisassemblyTest_7_9.class, MIDisassemblyTest_7_9.class,
GDBProcessesTest_7_9.class, GDBProcessesTest_7_9.class,