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 99d3f54c709..514bc795cb9 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 08fd209f524..1230a7a6f90 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 f3e548d4440..eb2debdbe3f 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 14c3116b0e9..a55c6037afe 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 3136a221ed4..1e4cd5ccb38 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; }