1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

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>
This commit is contained in:
Simon Marchi 2014-12-23 11:20:33 -05:00 committed by Marc Khouzam
parent 1333b20ec5
commit dd4ae589c2
5 changed files with 27 additions and 22 deletions

View file

@ -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());

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}