Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Marchi2014-12-23 16:20:33 +0000
committerMarc Khouzam2014-12-23 19:42:12 +0000
commitdd4ae589c25dd31bf4b2d447becc280b5f645de4 (patch)
treeacc31d9804c73870d1796b50394af29075e6d200
parent1333b20ec54f01c7dfdbb44d430102a07b73d97e (diff)
downloadorg.eclipse.cdt-dd4ae589c25dd31bf4b2d447becc280b5f645de4.tar.gz
org.eclipse.cdt-dd4ae589c25dd31bf4b2d447becc280b5f645de4.tar.xz
org.eclipse.cdt-dd4ae589c25dd31bf4b2d447becc280b5f645de4.zip
debug tests: Add runningOnWindows() method to BaseTestCase
Change-Id: Ic7fd197cdaddf8824ac1ef43261c056678433865 Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> Reviewed-on: https://git.eclipse.org/r/38727 Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com> Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java7
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java20
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java10
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java6
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIBreakpointsTest_6_8.java6
5 files changed, 27 insertions, 22 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java
index 99d3f54c70..514bc795cb 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Ericsson - Initial Implementation
+ * Simon Marchi (Ericsson) - Add and use runningOnWindows().
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.framework;
@@ -368,7 +369,7 @@ public class BaseTestCase {
*/
public static void setGdbProgramNamesLaunchAttributes(String version) {
// See bugzilla 303811 for why we have to append ".exe" on Windows
- boolean isWindows = Platform.getOS().equals(Platform.OS_WIN32);
+ boolean isWindows = runningOnWindows();
String gdbPath = System.getProperty("cdt.tests.dsf.gdb.path");
String debugName = "gdb." + version + (isWindows ? ".exe" : "");
String debugServerName = "gdbserver." + version + (isWindows ? ".exe" : "");
@@ -400,6 +401,10 @@ public class BaseTestCase {
}
}
+ protected static boolean runningOnWindows() {
+ return Platform.getOS().equals(Platform.OS_WIN32);
+ }
+
@BeforeClass
public static void setGlobalPreferences() {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java
index 08fd209f52..1230a7a6f9 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Ericsson and others.
+ * Copyright (c) 2007, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Ericsson - Initial Implementation
+ * Simon Marchi (Ericsson) - Use runningOnWindows().
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests;
@@ -55,7 +56,6 @@ import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
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.launching.TestsPlugin;
-import org.eclipse.core.runtime.Platform;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -1283,7 +1283,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -1338,7 +1338,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -1545,7 +1545,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -1837,7 +1837,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -2067,7 +2067,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -2423,7 +2423,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -2570,7 +2570,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -2747,7 +2747,7 @@ public class MIBreakpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java
index f3e548d444..eb2debdbe3 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MICatchpointsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Ericsson and others.
+ * Copyright (c) 2007, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Ericsson - Initial Implementation
+ * Simon Marchi (Ericsson) - Add and use runningOnWindows().
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests;
@@ -61,7 +62,6 @@ import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
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.launching.TestsPlugin;
-import org.eclipse.core.runtime.Platform;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -754,7 +754,7 @@ public class MICatchpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -951,7 +951,7 @@ public class MICatchpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
@@ -1106,7 +1106,7 @@ public class MICatchpointsTest extends BaseTestCase {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java
index 14c3116b0e..a55c6037af 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Ericsson and others.
+ * Copyright (c) 2007, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Ericsson AB - Initial implementation of Test cases
+ * Simon Marchi (Ericsson) - Add and use runningOnWindows().
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests;
@@ -51,7 +52,6 @@ import org.eclipse.cdt.tests.dsf.gdb.framework.ServiceEventWaitor;
import org.eclipse.cdt.tests.dsf.gdb.framework.SyncUtil;
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@@ -141,7 +141,7 @@ public class MIRunControlTest extends BaseTestCase {
// for 'cygwin1.dll'. In the real world, this wouldn't cut mustard, but
// since this is just testing code, and we control the programs, it's a
// no brainer.
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
// This is interesting. Our tests rely on the working directory.
// That is, we specify a program path in the launch configuration
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIBreakpointsTest_6_8.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIBreakpointsTest_6_8.java
index 3136a221ed..1e4cd5ccb3 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIBreakpointsTest_6_8.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIBreakpointsTest_6_8.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Ericsson and others.
+ * Copyright (c) 2009, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Ericsson - Initial Implementation
+ * Simon Marchi (Ericsson) - Add and use runningOnWindows().
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;
@@ -22,7 +23,6 @@ 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.eclipse.core.runtime.Platform;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -159,7 +159,7 @@ public class MIBreakpointsTest_6_8 extends MIBreakpointsTest_6_7 {
// 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 (Platform.getOS().equals(Platform.OS_WIN32)) {
+ if (runningOnWindows()) {
return;
}

Back to the top