Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2018-03-20 09:15:40 +0000
committerJonah Graham2018-03-20 09:16:00 +0000
commit6a0de9f520244445d13423f244089b9865953526 (patch)
tree9d556261e3c1510a510f52e6505b1e912ec34795
parent60affd8b9f98c07b0dac9176964250b67029ef70 (diff)
downloadorg.eclipse.cdt-6a0de9f520244445d13423f244089b9865953526.tar.gz
org.eclipse.cdt-6a0de9f520244445d13423f244089b9865953526.tar.xz
org.eclipse.cdt-6a0de9f520244445d13423f244089b9865953526.zip
Bug 532592: [tests] cleanup use of DEBUGGER_MODE_REMOTE in tests
Be consistent in using DEBUGGER_MODE_REMOTE to set remote session in parameterized tests. Change-Id: Ie8db7df02ec575f3e89d22e00b06e4e197833a37
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java3
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseRemoteSuite.java32
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java4
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java2
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java6
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java5
6 files changed, 8 insertions, 44 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java
index 7568bb99e6..79e444706c 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java
@@ -195,9 +195,10 @@ public abstract class BaseParametrizedTestCase extends BaseTestCase {
assumeGdbVersionAtLeast(gdbVersionPostfix);
setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, gdbPath);
setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, gdbServerPath);
- if (remote)
+ if (remote) {
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
+ }
}
@Override
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseRemoteSuite.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseRemoteSuite.java
deleted file mode 100644
index f1f4091426..0000000000
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseRemoteSuite.java
+++ /dev/null
@@ -1,32 +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.framework;
-
-import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
-import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-
-/**
- * This base class sets the attributes necessary to do a
- * remote debugging session.
- */
-public class BaseRemoteSuite {
- @BeforeClass
- public static void baseRemoteSuiteBeforeClassMethod() {
- BaseTestCase.setGlobalLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
- }
- @AfterClass
- public static void baseRemoteSuiteAfterClassMethod() {
- BaseTestCase.removeGlobalLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE);
- }
-}
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java
index 9d5698cda2..45a7079165 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/CommandTimeoutTest.java
@@ -149,10 +149,10 @@ public class CommandTimeoutTest extends BaseParametrizedTestCase {
node.putInt( IGdbDebugPreferenceConstants.PREF_COMMAND_TIMEOUT_VALUE, 1000 );
// Setup a remote launch so that it sends a "-target-remote" as part of the
- // launch steps.
+ // launch steps...
setLaunchAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE );
- // We won't start gdbserver, so the command will timeout
+ // ... but we won't start gdbserver, so the command will timeout
setLaunchAttribute( ITestConstants.LAUNCH_GDB_SERVER, false);
try {
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java
index 657b5a32b5..d572de3311 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBProcessesTest.java
@@ -110,8 +110,6 @@ public class GDBProcessesTest extends BaseParametrizedTestCase {
/*
* Return whether thread names are reported by the debugger.
- *
- * This defaults to false, and is overridden for specific versions of gdb.
*/
protected boolean threadNamesSupported() {
return !runningOnWindows() && !isRemoteSession();
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java
index f7828e09fe..1bea23bc65 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBRemoteTracepointsTest.java
@@ -164,6 +164,8 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase {
@Override
public void doBeforeTest() throws Exception {
+ // GDB tracepoints are only supported on a remote target (e.g., using gdbserver)
+ assumeRemoteSession();
super.doBeforeTest();
resolveLineTagLocations(SOURCE_NAME, LINE_TAGS);
@@ -203,10 +205,6 @@ public class GDBRemoteTracepointsTest extends BaseParametrizedTestCase {
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME);
- // GDB tracepoints are only supported on a remote target (e.g., using gdbserver)
- setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
-
// To test both fast and normal tracepoints, we use the FAST_THEN_NORMAL setting
setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_NORMAL);
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java
index bfda80c1fc..4a234a65d7 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/TraceFileTest.java
@@ -90,6 +90,8 @@ public class TraceFileTest extends BaseParametrizedTestCase {
@Override
public void doBeforeTest() throws Exception {
+ // GDB tracepoints are only supported on a remote target (e.g., using gdbserver)
+ assumeRemoteSession();
resolveLineTagLocations(SOURCE_NAME, LINE_TAGS);
assumeGdbVersionAtLeast(ITestConstants.SUFFIX_GDB_7_4);
removeTeminatedLaunchesBeforeTest();
@@ -341,9 +343,6 @@ public class TraceFileTest extends BaseParametrizedTestCase {
// Set launch attributes
super.setLaunchAttributes();
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME);
- // GDB tracepoints are only supported on a remote target (e.g., using gdbserver)
- setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
- IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);

Back to the top