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 fda09dbd9f0..e008c5b157f 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 @@ -87,7 +87,7 @@ public class BaseTestCase { @Rule public TestRule timeout = new Timeout(TEST_TIMEOUT); public static final String ATTR_DEBUG_SERVER_NAME = TestsPlugin.PLUGIN_ID + ".DEBUG_SERVER_NAME"; - private static final String DEFAULT_TEST_APP = "data/launch/bin/GDBMIGenericTestApp.exe"; + private static final String DEFAULT_EXEC_NAME = "GDBMIGenericTestApp.exe"; private static GdbLaunch fLaunch; @@ -215,7 +215,7 @@ public class BaseTestCase { // Clear all launch attributes before starting a new test launchAttributes = new HashMap(); - launchAttributes.put(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, DEFAULT_TEST_APP); + 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_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java index 8b4b5641f34..0bb20f4ba1f 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBConsoleBreakpointsTest.java @@ -67,12 +67,14 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class GDBConsoleBreakpointsTest extends BaseTestCase { + final static protected String SOURCE_NAME = "GDBMIGenericTestApp.cc"; + final static private int DEFAULT_TIMEOUT = 20000; final static private TimeUnit DEFAULT_TIME_UNIT = TimeUnit.MILLISECONDS; - final static private String FILE_NAME_VALID = new Path("data/launch/src/GDBMIGenericTestApp.cc").toFile().getAbsolutePath(); + final static private String SOURCE_NAME_VALID = new Path(SOURCE_PATH + SOURCE_NAME).toFile().getAbsolutePath(); final static private int LINE_NUMBER_VALID = 8; - final static private String FILE_NAME_INVALID = new Path("x.c").toFile().getAbsolutePath(); + final static private String SOURCE_NAME_INVALID = new Path("x.c").toFile().getAbsolutePath(); final static private int LINE_NUMBER_INVALID = 2; final static private String FUNCTION_VALID = "main()"; @@ -542,7 +544,7 @@ public class GDBConsoleBreakpointsTest extends BaseTestCase { private Map getLocationBreakpointAttributes(Class type, boolean valid) { Map map = new HashMap(); if (ICFunctionBreakpoint.class.equals(type)) { - map.put(ATTR_FILE_NAME, (valid) ? FILE_NAME_VALID : FILE_NAME_INVALID); + map.put(ATTR_FILE_NAME, (valid) ? SOURCE_NAME_VALID : SOURCE_NAME_INVALID); map.put(ATTR_FUNCTION, (valid) ? FUNCTION_VALID : FUNCTION_INVALID); } else if (ICAddressBreakpoint.class.equals(type)) { @@ -552,7 +554,7 @@ public class GDBConsoleBreakpointsTest extends BaseTestCase { new Addr64("0x0").toHexAddressString()); } else if (ICLineBreakpoint.class.equals(type)) { - map.put(ATTR_FILE_NAME, (valid) ? FILE_NAME_VALID : FILE_NAME_INVALID); + map.put(ATTR_FILE_NAME, (valid) ? SOURCE_NAME_VALID : SOURCE_NAME_INVALID); map.put(ATTR_LINE_NUMBER, (valid) ? LINE_NUMBER_VALID : LINE_NUMBER_INVALID); } return map; diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java index 2ffd45dd48f..c0369f173a7 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/GDBPatternMatchingExpressionsTest.java @@ -59,6 +59,7 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class GDBPatternMatchingExpressionsTest extends BaseTestCase { + private static final String EXEC_NAME = "PatternMatchingExpressionsTestApp.exe"; private DsfSession fSession; @@ -71,7 +72,7 @@ public class GDBPatternMatchingExpressionsTest extends BaseTestCase { protected void setLaunchAttributes() { super.setLaunchAttributes(); - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/PatternMatchingExpressionsTestApp.exe"); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } @Override diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java index e2ecf6bf6ef..9775a9e0906 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/LaunchConfigurationAndRestartTest.java @@ -53,11 +53,8 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class LaunchConfigurationAndRestartTest extends BaseTestCase { + protected static final String EXEC_NAME = "LaunchConfigurationAndRestartTestApp.exe"; - protected static final String PROGRAM_DIR = "data/launch/bin/"; - protected static final String PROGRAM_NAME = "LaunchConfigurationAndRestartTestApp.exe"; - protected static final String PROGRAM = PROGRAM_DIR + PROGRAM_NAME; - protected static final int FIRST_LINE_IN_MAIN = 27; protected static final int LAST_LINE_IN_MAIN = 30; @@ -82,7 +79,7 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase { super.setLaunchAttributes(); // Set the binary - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, PROGRAM); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } // This method cannot be tagged as @Before, because the launch is not @@ -138,16 +135,16 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase { // ********************************************************************* /** - * This test will tell the launch to set the working directory to data/launch/src/ + * This test will tell the launch to set the working directory to data/launch/bin/ * and will verify that we can find the file LaunchConfigurationAndRestartTestApp.cpp. * This will confirm that GDB has been properly configured with the working dir. */ @Test public void testSettingWorkingDirectory() throws Throwable { - IPath path = new Path(fFullProgramPath); - String dir = path.removeLastSegments(4).toPortableString() + "/" + PROGRAM_DIR; - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, dir); - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, dir + PROGRAM_NAME); + IPath path = new Path(fFullProgramPath); + String dir = path.removeLastSegments(4).toPortableString() + "/" + EXEC_PATH; + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, dir); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, dir + EXEC_NAME); doLaunch(); @@ -156,7 +153,7 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase { protected void execute(DataRequestMonitor rm) { fGdbControl.queueCommand( fGdbControl.getCommandFactory().createMIFileExecFile( - fGdbControl.getContext(), PROGRAM_NAME), + fGdbControl.getContext(), EXEC_NAME), rm); } }; @@ -685,7 +682,7 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase { // the JUnit tests. IFile fakeFile = null; - CDIDebugModel.createLineBreakpoint(PROGRAM, fakeFile, ICBreakpointType.REGULAR, LAST_LINE_IN_MAIN + 1, true, 0, "", true); //$NON-NLS-1$ + CDIDebugModel.createLineBreakpoint(EXEC_PATH + EXEC_NAME, fakeFile, ICBreakpointType.REGULAR, LAST_LINE_IN_MAIN + 1, true, 0, "", true); //$NON-NLS-1$ doLaunch(); MIStoppedEvent stoppedEvent = getInitialStoppedEvent(); 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 f11f359070f..d2f2ec20d0c 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 @@ -78,11 +78,11 @@ public class MIBreakpointsTest extends BaseTestCase { // Global constants public static final String PLUGIN_ID = "org.eclipse.cdt.debug.core" ; //$NON-NLS-1$ - public static final String TEST_APPL = "data/launch/bin/BreakpointTestApp.exe"; //$NON-NLS-1$ public static final String SOURCE_PROJECT = "MIBreakpointsTest"; public static final String SOURCE_FOLDER = "src"; - public static final String SOURCE_FILE = "BreakpointTestApp.cc"; //$NON-NLS-1$ + public static final String SOURCE_NAME = "BreakpointTestApp.cc"; //$NON-NLS-1$ + public static final String EXEC_NAME = "BreakpointTestApp.exe"; //$NON-NLS-1$ // Asynchronous Completion protected final AsyncCompletionWaitor fWait = new AsyncCompletionWaitor(); @@ -168,7 +168,7 @@ public class MIBreakpointsTest extends BaseTestCase { super.setLaunchAttributes(); // Select the binary to run the tests against - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, TEST_APPL); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } @Override @@ -511,7 +511,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, lineNumber); // Install the breakpoint @@ -690,7 +690,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Perform the test @@ -714,7 +714,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE + "_bad"); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME + "_bad"); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Perform the test @@ -738,7 +738,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, 0); // Perform the test @@ -762,7 +762,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a function breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, "invalid-function-name"); // Perform the test @@ -859,7 +859,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Perform the test @@ -877,7 +877,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint1.getFileName().equals(SOURCE_FILE)); + breakpoint1.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", breakpoint1.getLineNumber() == LINE_NUMBER_1); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -909,7 +909,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(IS_ENABLED_TAG, false); @@ -928,7 +928,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint1.getFileName().equals(SOURCE_FILE)); + breakpoint1.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", breakpoint1.getLineNumber() == LINE_NUMBER_1); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -960,7 +960,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a function breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, FUNCTION); // Perform the test @@ -978,7 +978,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint1.getFileName().equals(SOURCE_FILE)); + breakpoint1.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong function)", breakpoint1.getFunctionName().equals(SIGNED_FUNCTION)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -1008,7 +1008,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a conditional line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(CONDITION_TAG, CONDITION_1); @@ -1027,7 +1027,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint1.getFileName().equals(SOURCE_FILE)); + breakpoint1.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", breakpoint1.getLineNumber() == LINE_NUMBER_1); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -1057,7 +1057,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(IGNORE_COUNT_TAG, IGNORE_COUNT_1); @@ -1076,7 +1076,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint1.getFileName().equals(SOURCE_FILE)); + breakpoint1.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", breakpoint1.getLineNumber() == LINE_NUMBER_1); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -1106,7 +1106,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Perform the test @@ -1124,7 +1124,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint1.getFileName().equals(SOURCE_FILE)); + breakpoint1.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", breakpoint1.getLineNumber() == LINE_NUMBER_1); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -1137,7 +1137,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a function breakpoint breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, FUNCTION); // Perform the test @@ -1155,7 +1155,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint2 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint2.getFileName().equals(SOURCE_FILE)); + breakpoint2.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong function)", breakpoint2.getFunctionName().equals(SIGNED_FUNCTION)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -1196,7 +1196,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Perform the test @@ -1214,7 +1214,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint1 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint1.getFileName().equals(SOURCE_FILE)); + breakpoint1.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", breakpoint1.getLineNumber() == LINE_NUMBER_1); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -1239,7 +1239,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Ensure that the breakpoint was correctly installed MIBreakpointDMData breakpoint2 = (MIBreakpointDMData) getBreakpoint(ref); assertTrue("BreakpointService problem: breakpoint mismatch (wrong file name)", - breakpoint2.getFileName().equals(SOURCE_FILE)); + breakpoint2.getFileName().equals(SOURCE_NAME)); assertTrue("BreakpointService problem: breakpoint mismatch (wrong line number)", breakpoint2.getLineNumber() == LINE_NUMBER_1); assertTrue("BreakpointService problem: breakpoint mismatch (wrong condition)", @@ -1289,7 +1289,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); // Run the program. It will make a two second sleep() call, during which time... @@ -1356,7 +1356,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Now install a proper breakpoint an see that it hits without having to resume // the target. This will show that the target was still properly running. - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); MIBreakpointDMContext ref = (MIBreakpointDMContext) insertBreakpoint(fBreakpointsDmc, breakpoint); // Wait for breakpoint to hit and for the expected number of breakpoint events to have occurred @@ -1616,7 +1616,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -1674,7 +1674,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -1771,7 +1771,7 @@ public class MIBreakpointsTest extends BaseTestCase { for (int i = 0; i < 4; i++) { Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1 + i); insertBreakpoint(fBreakpointsDmc, breakpoint); assertTrue(fWait.getMessage(), fWait.isOK()); @@ -1843,7 +1843,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); // Install the breakpoint @@ -1901,7 +1901,7 @@ public class MIBreakpointsTest extends BaseTestCase { String expected = UNKNOWN_BREAKPOINT; Map properties = new HashMap(); properties.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - properties.put(FILE_NAME_TAG, SOURCE_FILE); + properties.put(FILE_NAME_TAG, SOURCE_NAME); properties.put(LINE_NUMBER_TAG, LINE_NUMBER_1); updateBreakpoint(invalid_ref, properties); assertFalse(fWait.getMessage(), fWait.isOK()); @@ -1924,7 +1924,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -1970,7 +1970,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(CONDITION_TAG, CONDITION_1); @@ -2017,7 +2017,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(CONDITION_TAG, CONDITION_1); @@ -2073,7 +2073,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); breakpoint.put(CONDITION_TAG, CONDITION_4); @@ -2280,7 +2280,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -2326,7 +2326,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(IGNORE_COUNT_TAG, IGNORE_COUNT_2); @@ -2373,7 +2373,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(IGNORE_COUNT_TAG, IGNORE_COUNT_1); @@ -2429,7 +2429,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); breakpoint.put(IGNORE_COUNT_TAG, IGNORE_COUNT_1); @@ -2491,7 +2491,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a first line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -2501,7 +2501,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a second line breakpoint breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_2); // Install the breakpoint @@ -2576,7 +2576,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); // Install the breakpoint @@ -2635,7 +2635,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a first line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -2645,7 +2645,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a second line breakpoint breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_2); // Install the breakpoint @@ -2753,7 +2753,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_5); breakpoint.put(IS_ENABLED_TAG, false); @@ -2813,7 +2813,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -2855,7 +2855,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a function breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, FUNCTION); // Install the breakpoint @@ -2899,7 +2899,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a conditional line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(CONDITION_TAG, CONDITION_1); @@ -2949,7 +2949,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a conditional line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint @@ -3012,7 +3012,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a conditional line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); breakpoint.put(IGNORE_COUNT_TAG, IGNORE_COUNT_2); @@ -3062,7 +3062,7 @@ public class MIBreakpointsTest extends BaseTestCase { // Create a conditional line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, LINE_NUMBER_1); // Install the breakpoint 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 eb2debdbe3f..6f13ac7f397 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 @@ -82,9 +82,8 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class MICatchpointsTest extends BaseTestCase { - private static final String TEST_APPL = "data/launch/bin/CatchpointTestApp.exe"; //$NON-NLS-1$ - - public static final String SOURCE_FILE = "CatchpointTestApp.cc"; //$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$ public static final int LINE_NUMBER_SLEEP_CALL = 17; @@ -185,7 +184,7 @@ public class MICatchpointsTest extends BaseTestCase { super.setLaunchAttributes(); // Select the binary to run the tests against - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, TEST_APPL); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } @Override @@ -1277,7 +1276,7 @@ public class MICatchpointsTest extends BaseTestCase { // Set the breakpoint Map breakpoint = new HashMap(); breakpoint.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); - breakpoint.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); + breakpoint.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); breakpoint.put(MIBreakpoints.LINE_NUMBER, lineNumber); IBreakpointDMContext refLineBkpt = insertBreakpoint(fBreakpointsDmc, breakpoint); assertTrue(fWait.getMessage(), fWait.isOK()); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIDisassemblyTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIDisassemblyTest.java index 66c2e034927..b24479b491d 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIDisassemblyTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIDisassemblyTest.java @@ -58,10 +58,10 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class MIDisassemblyTest extends BaseTestCase { - - private static final String FILE_NAME = "MemoryTestApp.cc"; + private static final String EXEC_NAME = "MemoryTestApp.exe"; + private static final String SOURCE_NAME = "MemoryTestApp.cc"; private static final int LINE_NUMBER = 35; - private static final String INVALID_FILE_NAME = "invalid_filename"; + private static final String INVALID_SOURCE_NAME = "invalid_filename"; private final AsyncCompletionWaitor fWait = new AsyncCompletionWaitor(); private DsfSession fSession; @@ -106,7 +106,7 @@ public class MIDisassemblyTest extends BaseTestCase { super.setLaunchAttributes(); // Select the binary to run the tests against - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/MemoryTestApp.exe"); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } @Override @@ -465,7 +465,7 @@ public class MIDisassemblyTest extends BaseTestCase { public void readWithValidFunction() throws Throwable { // Setup call parameters - String filename = INVALID_FILE_NAME; + String filename = INVALID_SOURCE_NAME; int linenum = 1; int count = -1; @@ -488,7 +488,7 @@ public class MIDisassemblyTest extends BaseTestCase { public void readWithInvalidLineNumber() throws Throwable { // Setup call parameters - String filename = FILE_NAME; + String filename = SOURCE_NAME; int linenum = -1; int count = -1; @@ -511,7 +511,7 @@ public class MIDisassemblyTest extends BaseTestCase { public void readWithValidFilename() throws Throwable { // Setup call parameters - String filename = FILE_NAME; + String filename = SOURCE_NAME; int linenum = LINE_NUMBER; int count = -1; @@ -533,7 +533,7 @@ public class MIDisassemblyTest extends BaseTestCase { public void readWithLineCount() throws Throwable { // Setup call parameters - String filename = FILE_NAME; + String filename = SOURCE_NAME; int linenum = LINE_NUMBER; int count = 5; @@ -578,7 +578,7 @@ public class MIDisassemblyTest extends BaseTestCase { public void readMixedWithLineCount() throws Throwable { // Setup call parameters - String filename = FILE_NAME; + String filename = SOURCE_NAME; int linenum = LINE_NUMBER; int count = 5; diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java index ab7bab201d0..83a013ad2c5 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIExpressionsTest.java @@ -63,6 +63,7 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class MIExpressionsTest extends BaseTestCase { + private static final String EXEC_NAME = "ExpressionTestApp.exe"; private DsfSession fSession; @@ -81,7 +82,7 @@ public class MIExpressionsTest extends BaseTestCase { protected void setLaunchAttributes() { super.setLaunchAttributes(); - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/ExpressionTestApp.exe"); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } @Override diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java index 8bdac904fbf..06cfce6b847 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIMemoryTest.java @@ -57,6 +57,7 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class MIMemoryTest extends BaseTestCase { + private static final String EXEC_NAME = "MemoryTestApp.exe"; private final AsyncCompletionWaitor fWait = new AsyncCompletionWaitor(); private DsfSession fSession; @@ -115,7 +116,7 @@ public class MIMemoryTest extends BaseTestCase { super.setLaunchAttributes(); // Select the binary to run the tests against - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/MemoryTestApp.exe"); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } @Override diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java index 6dc58f5dde9..4432d80b2fb 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java @@ -57,16 +57,11 @@ public class MIRunControlTargetAvailableTest extends BaseTestCase { private IContainerDMContext fContainerDmc; - /* - * Path to executable - */ - private static final String EXEC_PATH = "data/launch/bin/"; /* * Name of the executable */ private static final String EXEC_NAME = "TargetAvail.exe"; - private static final String SOURCE_NAME = "TargetAvail.cc"; - + @Override public void doBeforeTest() throws Exception { super.doBeforeTest(); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java index c1861ec3f9e..ef9b964686c 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/OperationsWhileTargetIsRunningTest.java @@ -61,7 +61,6 @@ public class OperationsWhileTargetIsRunningTest extends BaseTestCase { private IMIContainerDMContext fContainerDmc; private IGDBControl fControl; - private static final String EXEC_PATH = "data/launch/bin/"; private static final String EXEC_NAME = "TargetAvail.exe"; private static boolean fgAutoTerminate; diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java index 987efba0659..bc6ecba1432 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/PostMortemCoreTest.java @@ -57,6 +57,9 @@ import org.junit.runner.RunWith; @RunWith(BackgroundRunner.class) public class PostMortemCoreTest extends BaseTestCase { + private static final String EXEC_NAME = "ExpressionTestApp.exe"; + private static final String INVALID_CORE_NAME = "MultiThread.exe"; + private static final String CORE_NAME = "core"; private DsfSession fSession; @@ -83,7 +86,7 @@ public class PostMortemCoreTest extends BaseTestCase { // especially in the case of a relative path setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "${workspace_loc}"); // Because we just set a different working directory, we must use an absolute path for the program - String absoluteProgram = new Path("data/launch/bin/ExpressionTestApp.exe").toFile().getAbsolutePath(); + String absoluteProgram = new Path(EXEC_PATH + EXEC_NAME).toFile().getAbsolutePath(); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, absoluteProgram); // Set post-mortem launch @@ -93,7 +96,7 @@ public class PostMortemCoreTest extends BaseTestCase { setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_POST_MORTEM_TYPE, IGDBLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_CORE_FILE); // Set default core file path - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, "data/launch/bin/core"); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, EXEC_PATH + CORE_NAME); } // This method cannot be tagged as @Before, because the launch is not @@ -144,7 +147,7 @@ public class PostMortemCoreTest extends BaseTestCase { */ @Test public void testAbsoluteCoreFilePath() throws Throwable { - File file = new File("data/launch/bin/core"); + File file = new File(EXEC_PATH + CORE_NAME); assertTrue("Cannot find test file; " + file.toString(), file.exists()); String absoluteCoreFile = file.getAbsolutePath(); @@ -161,7 +164,7 @@ public class PostMortemCoreTest extends BaseTestCase { */ @Test public void testRelativeCoreFilePath() throws Throwable { - File file = new File("data/launch/bin/core"); + File file = new File(EXEC_PATH + CORE_NAME); assertTrue("Cannot find test file; " + file.toString(), file.exists()); String relativeCoreFile = file.toString(); @@ -178,7 +181,7 @@ public class PostMortemCoreTest extends BaseTestCase { */ @Test public void testAbsoluteCoreFilePathInvalid() throws Throwable { - File file = new File("data/launch/bin/MultiThread.exe"); + File file = new File(EXEC_PATH + INVALID_CORE_NAME); assertTrue("Cannot find test file: " + file.toString(), file.exists()); String absoluteCoreFile = file.getAbsolutePath(); @@ -200,7 +203,7 @@ public class PostMortemCoreTest extends BaseTestCase { */ @Test public void testRelativeCoreFilePathInvalid() throws Throwable { - File file = new File("data/launch/bin/MultiThread.exe"); + File file = new File(EXEC_PATH + INVALID_CORE_NAME); assertTrue("Cannot find test file: " + file.toString(), file.exists()); String relativeCoreFile = file.toString(); @@ -222,7 +225,7 @@ public class PostMortemCoreTest extends BaseTestCase { */ @Test public void testAbsoluteCoreFilePathMissing() throws Throwable { - File file = new File("data/launch/bin/MissingFile"); + File file = new File(EXEC_PATH + "MissingFile"); assertTrue("Should not have found test file: " + file.toString(), !file.exists()); String absoluteCoreFile = file.getAbsolutePath(); @@ -244,7 +247,7 @@ public class PostMortemCoreTest extends BaseTestCase { */ @Test public void testRelativeCoreFilePathMissing() throws Throwable { - File file = new File("data/launch/bin/MissingFile"); + File file = new File(EXEC_PATH + "MissingFile"); assertTrue("Should not have found test file: " + file.toString(), !file.exists()); String relativeCoreFile = file.toString(); @@ -278,7 +281,7 @@ public class PostMortemCoreTest extends BaseTestCase { // properly. // Absolute path of the core file - File file = new File("data/launch/bin/core"); + File file = new File(EXEC_PATH + CORE_NAME); String absoluteCoreFile = file.getAbsolutePath(); // Variable for workspace location diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java index 75bb1f978d1..bdc26da475d 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/StepIntoSelectionTest.java @@ -54,8 +54,9 @@ public class StepIntoSelectionTest extends BaseTestCase { private IRunControl3 fRunCtrl; - private static final String SRC_FILE = "StepIntoSelectionTestApp.cc"; - private static final String HDR_FILE = "StepIntoSelection.h"; + private static final String EXEC_NAME = "StepIntoSelectionTestApp.exe"; + private static final String SOURCE_NAME = "StepIntoSelectionTestApp.cc"; + private static final String HEADER_NAME = "StepIntoSelection.h"; private static final int FOO_LINE = 11; private static final int BAR_LINE = 20; private static final int VALUE_LINE = 5; @@ -119,7 +120,7 @@ public class StepIntoSelectionTest extends BaseTestCase { @Override protected void setLaunchAttributes() { super.setLaunchAttributes(); - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/StepIntoSelectionTestApp.exe"); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } private void validateLocation(ISuspendedDMEvent suspendedEvent, String expectedFunction, @@ -224,10 +225,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcFoo; // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, stoppedEvent.getFrame().getLine(), targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, FOO_LINE, originalDepth + 1); } /** @@ -241,10 +242,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcFoo; int line = stoppedEvent.getFrame().getLine() + 3; // The method to stepInto is three lines below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, FOO_LINE, originalDepth + 1); } /** @@ -258,10 +259,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcValue; int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), HDR_FILE, VALUE_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), HEADER_NAME, VALUE_LINE, originalDepth + 1); } /** @@ -276,10 +277,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcFoo; int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, FOO_LINE, originalDepth + 1); } /** @@ -294,10 +295,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcBar; int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, BAR_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, BAR_LINE, originalDepth + 1); } /** @@ -313,10 +314,10 @@ public class StepIntoSelectionTest extends BaseTestCase { int line = stoppedEvent.getFrame().getLine() + 2; // The method to stepInto is two lines below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, finalLine, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, finalLine, originalDepth + 1); } /** @@ -340,10 +341,10 @@ public class StepIntoSelectionTest extends BaseTestCase { int line = originalLine + 3; // The method to stepInto is three lines below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); - validateLocation(suspendedEvent, functionName, SRC_FILE, bpline, originalDepth); + validateLocation(suspendedEvent, functionName, SOURCE_NAME, bpline, originalDepth); } /** @@ -364,16 +365,16 @@ public class StepIntoSelectionTest extends BaseTestCase { SyncUtil.addBreakpoint(Integer.toString(bpline)); // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); // Don't skip breakpoints - validateLocation(suspendedEvent, functionName, SRC_FILE, bpline, originalDepth); + validateLocation(suspendedEvent, functionName, SOURCE_NAME, bpline, originalDepth); // Make sure the step to selection operation is no longer active by triggering a run to line before the step into selection line - suspendedEvent = triggerRunToLine(stoppedEvent.getDMContext(), SRC_FILE, + suspendedEvent = triggerRunToLine(stoppedEvent.getDMContext(), SOURCE_NAME, bpline + 1, false); - validateLocation(suspendedEvent, functionName, SRC_FILE, bpline + 1, originalDepth); + validateLocation(suspendedEvent, functionName, SOURCE_NAME, bpline + 1, originalDepth); } @@ -393,16 +394,16 @@ public class StepIntoSelectionTest extends BaseTestCase { int line = originalLine + 3; // The method to stepInto is three lines below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, funcFoo, false); - validateLocation(suspendedEvent, functionName, SRC_FILE, originalLine + 1, originalDepth); + validateLocation(suspendedEvent, functionName, SOURCE_NAME, originalLine + 1, originalDepth); // Make sure the step to selection operation is no longer active by triggering a run to line before the step into selection line - suspendedEvent = triggerRunToLine(stoppedEvent.getDMContext(), SRC_FILE, + suspendedEvent = triggerRunToLine(stoppedEvent.getDMContext(), SOURCE_NAME, originalLine + 2, false); - validateLocation(suspendedEvent, functionName, SRC_FILE, originalLine + 2, originalDepth); + validateLocation(suspendedEvent, functionName, SOURCE_NAME, originalLine + 2, originalDepth); } /** @@ -424,10 +425,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcFoo; // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, true); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, FOO_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, FOO_LINE, originalDepth + 1); } private void atDoubleMethodStopAtBreakpointCommon(int foo_line) throws Throwable { @@ -441,10 +442,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcBar; int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, false); // Set not to skip breakpoints, but it should have no effect - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, BAR_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, BAR_LINE, originalDepth + 1); } /** @@ -481,10 +482,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcBar; int line = stoppedEvent.getFrame().getLine() + 1; // The method to stepInto is one line below the start of the method // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, line, targetFunction, true); // Set skip breakpoints, which should have non impact - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, BAR_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, BAR_LINE, originalDepth + 1); } /** @@ -522,10 +523,10 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcAddWithArg; // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, stoppedEvent.getFrame().getLine(), targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, ADD_WITH_ARG_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, ADD_WITH_ARG_LINE, originalDepth + 1); } @Test @@ -535,9 +536,9 @@ public class StepIntoSelectionTest extends BaseTestCase { FunctionDeclaration targetFunction = funcAddNoArg; // StepInto the method - ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SRC_FILE, + ISuspendedDMEvent suspendedEvent = triggerStepIntoSelection(stoppedEvent.getDMContext(), SOURCE_NAME, stoppedEvent.getFrame().getLine(), targetFunction, false); - validateLocation(suspendedEvent, targetFunction.getElementName(), SRC_FILE, ADD_NO_ARG_LINE, originalDepth + 1); + validateLocation(suspendedEvent, targetFunction.getElementName(), SOURCE_NAME, ADD_NO_ARG_LINE, originalDepth + 1); } } 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 1e4cd5ccb38..27dffcc7348 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 @@ -57,7 +57,7 @@ public class MIBreakpointsTest_6_8 extends MIBreakpointsTest_6_7 { // Create an invalid line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE + "_bad"); + 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 @@ -108,7 +108,7 @@ public class MIBreakpointsTest_6_8 extends MIBreakpointsTest_6_7 { // Create an invalid function breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(FUNCTION_TAG, "invalid-function-name"); // Perform the test, which we still expect to succeed diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBMultiNonStopRunControlTest_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBMultiNonStopRunControlTest_7_0.java index cf582aaff0a..d35bafbb874 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBMultiNonStopRunControlTest_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBMultiNonStopRunControlTest_7_0.java @@ -55,11 +55,7 @@ public class GDBMultiNonStopRunControlTest_7_0 extends BaseTestCase { private DsfServicesTracker fServicesTracker; private IMultiRunControl fMultiRun; - - /* - * Path to executable - */ - private static final String EXEC_PATH = "data/launch/bin/"; + /* * Name of the executable */ diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBRemoteTracepointsTest_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBRemoteTracepointsTest_7_0.java index 4f7a9144577..3aeb400107f 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBRemoteTracepointsTest_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/GDBRemoteTracepointsTest_7_0.java @@ -66,7 +66,8 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase { // private int fTotalTracingBufferSize = 0; - protected static final String SOURCE_FILE = "TracepointTestApp.cc"; + protected static final String EXEC_NAME = "TracepointTestApp.exe"; + protected static final String SOURCE_NAME = "TracepointTestApp.cc"; protected static final int LINE_NUMBER_1_BYTE_INSTR = 28; protected static final int LINE_NUMBER_2_BYTE_INSTR = 15; protected static final int LINE_NUMBER_3_BYTE_INSTR = 17; @@ -185,7 +186,7 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase { protected void setLaunchAttributes() { super.setLaunchAttributes(); - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/TracepointTestApp.exe"); + 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, @@ -588,7 +589,7 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase { boolean isFastTp; public TracepointData(int line, String cond, int pass, boolean isEnabled, String cmds, boolean fast) { - this(SOURCE_FILE, line, cond, pass, isEnabled, cmds, fast); + this(SOURCE_NAME, line, cond, pass, isEnabled, cmds, fast); } public TracepointData(String file, int line, String cond, int pass, boolean isEnabled, String cmds, boolean fast) { @@ -669,7 +670,7 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase { for (int i = 0; i < lineNumbers.length; i++) { attributes = new HashMap(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); - attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); + attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.LINE_NUMBER, lineNumbers[i]); if (!enabled) attributes.put(MIBreakpoints.IS_ENABLED, enabled); if (useCount) attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[i]); @@ -897,7 +898,7 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase { for (int i = 0; i < lineNumbers.length; i++) { attributes = new HashMap(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); - attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE); + attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.LINE_NUMBER, lineNumbers[i]); attributes.put(MIBreakpoints.COMMANDS, cmdNames[i]); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java index 286b16ceaf5..c9fb9d43bbf 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java @@ -45,7 +45,7 @@ public class MIBreakpointsTest_7_4 extends MIBreakpointsTest_7_3 { // Create a line breakpoint Map breakpoint = new HashMap(); breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG); - breakpoint.put(FILE_NAME_TAG, SOURCE_FILE); + breakpoint.put(FILE_NAME_TAG, SOURCE_NAME); breakpoint.put(LINE_NUMBER_TAG, 0); // Perform the test diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/TraceFileTest_7_4.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/TraceFileTest_7_4.java index c54ba055d87..51be3e3e3f3 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/TraceFileTest_7_4.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/TraceFileTest_7_4.java @@ -64,15 +64,15 @@ import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TraceFileTest_7_4 extends BaseTestCase { - private final static String FILE_NAME = "TracepointTestApp.cc"; - private final static String EXECUTABLE_PATH = "data/launch/bin/TracepointTestApp.exe"; + private final static String SOURCE_NAME = "TracepointTestApp.cc"; + private final static String EXEC_NAME = "TracepointTestApp.exe"; + private final static String TRACE_NAME = "trace"; private final static int LINE_NUMBER_1 = 17; private final static int LINE_NUMBER_2 = 24; private final static String END_FUNCTION = "lastCall"; private final static String TEVAL_STRING = "a"; private final static String COLLECT_STRING1 = "x"; private final static String COLLECT_STRING2 = "$regs"; - private final static String TRACE_FILE = "data/launch/bin/trace"; private DsfSession fSession; private DsfServicesTracker fServicesTracker; @@ -184,7 +184,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { // especially in the case of a relative path setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "${workspace_loc}"); // Because we just set a different working directory, we must use an absolute path for the program - String absoluteProgram = new Path("data/launch/bin/TracepointTestApp.exe").toFile().getAbsolutePath(); + String absoluteProgram = new Path(EXEC_PATH + EXEC_NAME).toFile().getAbsolutePath(); setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, absoluteProgram); // Set post-mortem launch @@ -194,7 +194,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_POST_MORTEM_TYPE, IGDBLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_TRACE_FILE); // Set core file path - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, TRACE_FILE); + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, EXEC_PATH + TRACE_NAME); doLaunch(); @@ -242,7 +242,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { private void checkTracepoint(ICTracepoint tracepoint) throws Throwable { TracepointActionManager tam = TracepointActionManager.getInstance(); - assertTrue(FILE_NAME.equals(new Path(tracepoint.getFileName()).lastSegment())); + assertTrue(SOURCE_NAME.equals(new Path(tracepoint.getFileName()).lastSegment())); assertTrue(LINE_NUMBER_1 == tracepoint.getLineNumber() || LINE_NUMBER_2 == tracepoint.getLineNumber()); String[] actionNames = ((String)tracepoint.getMarker().getAttribute(BreakpointActionManager.BREAKPOINT_ACTION_ATTRIBUTE)).split(TracepointActionManager.TRACEPOINT_ACTION_DELIMITER); @@ -262,7 +262,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { private void startRemoteSession() throws Throwable { // Set launch attributes super.setLaunchAttributes(); - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXECUTABLE_PATH); + 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); @@ -347,7 +347,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { private MIBreakpointDMContext setBreakpointAtEndLine() throws Throwable { Map attributes = new HashMap(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.BREAKPOINT); - attributes.put(MIBreakpoints.FILE_NAME, FILE_NAME); + attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.FUNCTION, END_FUNCTION); IBreakpointDMContext bptDMC = insertBreakpoint(fBreakpointsDmc, attributes); assertTrue(bptDMC instanceof MIBreakpointDMContext); @@ -375,7 +375,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { Map attributes = new HashMap(); attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT); - attributes.put(MIBreakpoints.FILE_NAME, FILE_NAME); + attributes.put(MIBreakpoints.FILE_NAME, SOURCE_NAME); attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1); attributes.put(MIBreakpoints.COMMANDS, evalAction.getName()); insertBreakpoint(fBreakpointsDmc, attributes); @@ -414,7 +414,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { } private void saveTraceData() throws Throwable { - final File traceFile = new Path(TRACE_FILE).toFile(); + final File traceFile = new Path(EXEC_PATH + TRACE_NAME).toFile(); final AsyncCompletionWaitor wait = new AsyncCompletionWaitor(); fSession.getExecutor().submit(new Runnable() { @@ -440,7 +440,7 @@ public class TraceFileTest_7_4 extends BaseTestCase { } private void deleteOldTraceFile() throws Throwable { - File traceFile = new Path(TRACE_FILE).toFile(); + File traceFile = new Path(EXEC_PATH + TRACE_NAME).toFile(); traceFile.delete(); assertFalse(traceFile.exists()); } diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/GDBConsoleSynchronizingTest_7_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/GDBConsoleSynchronizingTest_7_6.java index be522c0521d..8da25465a89 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/GDBConsoleSynchronizingTest_7_6.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_6/GDBConsoleSynchronizingTest_7_6.java @@ -59,6 +59,7 @@ import org.junit.runner.RunWith; */ @RunWith(BackgroundRunner.class) public class GDBConsoleSynchronizingTest_7_6 extends BaseTestCase { + final static private String EXEC_NAME = "ConsoleSyncTestApp.exe"; final static private int DEFAULT_TIMEOUT = 1000; final static private TimeUnit DEFAULT_TIME_UNIT = TimeUnit.MILLISECONDS; @@ -83,8 +84,8 @@ public class GDBConsoleSynchronizingTest_7_6 extends BaseTestCase { @Override protected void setLaunchAttributes() { super.setLaunchAttributes(); - - setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "data/launch/bin/ConsoleSyncTestApp.exe"); + + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EXEC_PATH + EXEC_NAME); } @Override