diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/TargetAvail.cc b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/TargetAvail.cc new file mode 100644 index 00000000000..5db1f95a629 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/TargetAvail.cc @@ -0,0 +1,45 @@ + +#include +#include "Sleep.h" + + +void PrintHello() +{ + printf("Hello World!\n"); + + SLEEP(1); + +} + +void PrintHi() +{ + printf("Hi everybody!\n"); + + SLEEP(1); + +} + +void PrintBonjour() +{ + printf("Bonjour!\n"); + + SLEEP(1); + +} + +int main(int argc, char *argv[]) +{ + printf("In main\n"); + + SLEEP(1); + + SLEEP(1); + + PrintHello(); + + PrintHi(); + + PrintBonjour(); + + return 0; +} 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 new file mode 100644 index 00000000000..857e5f9c1ec --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIRunControlTargetAvailableTest.java @@ -0,0 +1,913 @@ +/******************************************************************************* + * Copyright (c) 2007, 2010 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson AB - Initial implementation of Test cases + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests; + + +import static org.junit.Assert.fail; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; +import org.eclipse.cdt.dsf.concurrent.CountingRequestMonitor; +import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor; +import org.eclipse.cdt.dsf.concurrent.Query; +import org.eclipse.cdt.dsf.concurrent.RequestMonitor; +import org.eclipse.cdt.dsf.concurrent.Sequence.Step; +import org.eclipse.cdt.dsf.datamodel.DMContexts; +import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; +import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext; +import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; +import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent; +import org.eclipse.cdt.dsf.gdb.service.command.IGDBControl; +import org.eclipse.cdt.dsf.mi.service.IMIProcesses; +import org.eclipse.cdt.dsf.mi.service.IMIRunControl; +import org.eclipse.cdt.dsf.mi.service.MIProcesses; +import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo; +import org.eclipse.cdt.dsf.service.DsfServicesTracker; +import org.eclipse.cdt.dsf.service.DsfSession; +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.ServiceEventWaitor; +import org.eclipse.cdt.tests.dsf.gdb.framework.SyncUtil; +import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; + + +/** + * Tests MIRunControl class for for the execWhileTargetAvailable() method. + */ +@RunWith(BackgroundRunner.class) +public class MIRunControlTargetAvailableTest extends BaseTestCase { + + private static final String TIMEOUT_MESSAGE = "Timeout"; + + private DsfServicesTracker fServicesTracker; + + private IGDBControl fGDBCtrl; + private IMIRunControl fRunCtrl; + + 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"; + + @Before + public void init() throws Exception { + final DsfSession session = getGDBLaunch().getSession(); + + Runnable runnable = new Runnable() { + public void run() { + fServicesTracker = + new DsfServicesTracker(TestsPlugin.getBundleContext(), + session.getId()); + fGDBCtrl = fServicesTracker.getService(IGDBControl.class); + + IMIProcesses procService = fServicesTracker.getService(IMIProcesses.class); + IProcessDMContext procDmc = procService.createProcessContext(fGDBCtrl.getContext(), MIProcesses.UNIQUE_GROUP_ID); + fContainerDmc = procService.createContainerContext(procDmc, MIProcesses.UNIQUE_GROUP_ID); + + fRunCtrl = fServicesTracker.getService(IMIRunControl.class); + } + }; + session.getExecutor().submit(runnable).get(); + } + + + @After + public void tearDown() { + fServicesTracker.dispose(); + } + + @BeforeClass + public static void beforeClassMethod() { + setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, + EXEC_PATH + EXEC_NAME); + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for a single operation with a single step when the target is stopped. + */ + @Test + public void executeSingleStepSingleOpWhileTargetStopped() throws Throwable { + // The target is currently stopped. + + // A single step that will set a breakpoint at PrintHello, which we will then make sure hits + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }} + }; + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + // Now resume the target and check that we stop at the breakpoint. + + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + // Wait up to 3 second for the target to suspend. Should happen within 2 second. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for a single operation with a single step when the target is running. + */ + @Test + public void executeSingleStepSingleOpWhileTargetRunning() throws Throwable { + // A single step that will set a breakpoint at PrintHello, which we will then make sure hits + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }} + }; + + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + // Now check that the target is stopped at the breakpoint. + // Wait up to 3 second for the target to suspend. Should happen at most in 2 seconds. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for a single operation with multiple steps when the target is stopped. + */ + @Test + public void executeMultiStepSingleOpWhileTargetStopped() throws Throwable { + // The target is currently stopped. + + // Multiple steps that will set three temp breakpoints at three different lines + // We then check that the target will stop three times + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHi", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }} + }; + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + // Now resume the target three times and check that we stop three times. + for (int i=0; i suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + // Wait up to 3 second for the target to suspend. Should happen within 2 seconds. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + } + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for a single operation with multiple steps when the target is stopped + * and one of the steps fails. + */ + @Test + public void executeMultiStepSingleOpWhileTargetStoppedWithError() throws Throwable { + // The target is currently stopped. + + // Multiple steps that will set three temp breakpoints at three different lines + // We then check that the target will stop three times + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, "invalid condition", 0, "PrintHi", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }} + }; + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + // We want to detect the error, so this is success + return; + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + fail("Did not detect the error of the step"); + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for a single operation with multiple steps when the target is running. + */ + @Test + public void executeMultiStepSingleOpWhileTargetRunning() throws Throwable { + // Multiple steps that will set three temp breakpoints at three different lines + // We then check that the target will stop three times + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHi", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }} + }; + + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + // Now resume the target three times and check that we stop three times. + for (int i=0; i( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + } + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for a single operation with multiple steps when the target is running + * and one of the steps fails. + */ + @Test + public void executeMultiStepSingleOpWhileTargetRunningWithError() throws Throwable { + // Multiple steps that will set three temp breakpoints at three different lines + // We then check that the target will stop three times + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintHello", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, "invalid condition", 0, "PrintHi", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }}, + new Step() { + @Override + public void execute(RequestMonitor rm) { + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, "PrintBonjour", 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm)); + }} + }; + + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + Query query = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + + boolean caughtError = false; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + caughtError = true; + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + Assert.assertTrue("Did not catch the error of the step", caughtError); + + // Now make sure the target stop of the first breakpoint + // Wait up to 3 second for the target to suspend. Should happen within two seconds. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for concurrent operations with a single step when the target is stopped. + */ + @Test + public void executeSingleStepConcurrentOpWhileTargetStopped() throws Throwable { + // The target is currently stopped. + + final int NUM_CONCURRENT = 3; + + String[] locations = { "PrintHello", "PrintHi", "PrintBonjour" }; + final Step[][] steps = new Step[NUM_CONCURRENT][1]; // one step for each concurrent operation + for (int i=0; i (fGDBCtrl.getExecutor(), rm)); + }} + }; + } + + Query query = new Query() { + @Override + protected void execute(final DataRequestMonitor rm) { + CountingRequestMonitor crm = new CountingRequestMonitor(fGDBCtrl.getExecutor(), null) { + @Override + protected void handleCompleted() { + rm.done(); + }; + }; + + + int index; + for (index=0; index suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + // Wait up to 3 second for the target to suspend. Should happen within 2 second. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + } + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for concurrent operations with a single step when the target is running. + */ + @Test + public void executeSingleStepConcurrentOpWhileTargetRunning() throws Throwable { + final int NUM_CONCURRENT = 3; + + String[] locations = { "PrintHello", "PrintHi", "PrintBonjour" }; + final Step[][] steps = new Step[NUM_CONCURRENT][1]; // one step for each concurrent operation + for (int i=0; i (fGDBCtrl.getExecutor(), rm)); + }} + }; + } + + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + Query query = new Query() { + @Override + protected void execute(final DataRequestMonitor rm) { + CountingRequestMonitor crm = new CountingRequestMonitor(fGDBCtrl.getExecutor(), null) { + @Override + protected void handleCompleted() { + rm.done(); + }; + }; + + + int index; + for (index=0; index( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + } + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for concurrent operations with a single step when the target is stopped. + * This tests verifies that we properly handle concurrent operations that are sent + * while other operations are already being run. + */ + @Test + public void executeSingleStepConcurrentButDelayedOpWhileTargetStopped() throws Throwable { + // The target is currently stopped. + + final String location = "PrintHello"; + final String location2 = "PrintHi"; + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor rm) { + final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm) { + @Override + protected void handleSuccess() { + // Now that time has elapsed, send another command + fRunCtrl.executeWithTargetAvailable(fContainerDmc, new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor rm) { + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), null)); + }}}, new RequestMonitor(fGDBCtrl.getExecutor(), null)); + + // Complete the first operation because the two are supposed to be independent + rm.done(); + }}); + }} + }; + + Query query = new Query() { + @Override + protected void execute(final DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + for (int i=0; i<2; i++) { + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + // Wait up to 3 second for the target to suspend. Should happen within 2 seconds. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + } + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for concurrent operations with a single step when the target is running. + * This tests verifies that we properly handle concurrent operations that are sent + * while other operations are already being run. + */ + @Test + public void executeSingleStepConcurrentButDelayedOpWhileTargetRunning() throws Throwable { + final String location = "PrintHello"; + final String location2 = "PrintHi"; + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor rm) { + final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm) { + @Override + protected void handleSuccess() { + // Now that time has elapsed, send another command + fRunCtrl.executeWithTargetAvailable(fContainerDmc, new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor otherRm) { + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), otherRm)); + }}}, new RequestMonitor(fGDBCtrl.getExecutor(), null)); + + // Complete the first operation because the two are supposed to be independent + rm.done(); + }}); + }} + }; + + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + Query query = new Query() { + @Override + protected void execute(final DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + for (int i=0; i<2; i++) { + // Wait up to 3 second for the target to suspend. Should happen within 2 seconds. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + + // Now resume the target and check that we stop at all the breakpoints. + suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + } + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for concurrent operations with a single step when the target is stopped. + * This tests verifies that we properly handle concurrent operations that are + * dependent on each other; this means that the second operation needs to complete + * for the second one to complete. + */ + @Test + public void executeSingleStepConcurrentAndDependentOpWhileTargetStopped() throws Throwable { + // The target is currently stopped. + + final String location = "PrintHello"; + final String location2 = "PrintHi"; + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor rm) { + final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm) { + @Override + protected void handleSuccess() { + // Send another such operation and wait for it to complete to mark the original one as completed + fRunCtrl.executeWithTargetAvailable(fContainerDmc, new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor otherRm) { + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), otherRm)); + }}}, rm); + }}); + }} + }; + + Query query = new Query() { + @Override + protected void execute(final DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + for (int i=0; i<2; i++) { + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + // Wait up to 3 second for the target to suspend. Should happen within 2 seconds. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + } + } + + /** + * Test that the executeWhileTargetAvailale interface works properly + * for concurrent operations with a single step when the target is running. + * This tests verifies that we properly handle concurrent operations that are + * dependent on each other; this means that the second operation needs to complete + * for the second one to complete. + */ + @Test + public void executeSingleStepConcurrentAndDependentOpWhileTargetRunning() throws Throwable { + final String location = "PrintHello"; + final String location2 = "PrintHi"; + final Step[] steps = new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor rm) { + final IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(fContainerDmc, IBreakpointsTargetDMContext.class); + + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), rm) { + @Override + protected void handleSuccess() { + // Send another such operation and wait for it to complete to mark the original one as completed + fRunCtrl.executeWithTargetAvailable(fContainerDmc, new Step[] { + new Step() { + @Override + public void execute(final RequestMonitor otherRm) { + fGDBCtrl.queueCommand( + fGDBCtrl.getCommandFactory().createMIBreakInsert(bpTargetDmc, true, false, null, 0, location2, 0), + new DataRequestMonitor (fGDBCtrl.getExecutor(), otherRm)); + }}}, rm); + }}); + }} + }; + + // The target is currently stopped so we resume it + ServiceEventWaitor suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + + Query query = new Query() { + @Override + protected void execute(final DataRequestMonitor rm) { + fRunCtrl.executeWithTargetAvailable(fContainerDmc, steps, rm); + } + }; + try { + fRunCtrl.getExecutor().execute(query); + query.get(500, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + fail(e.getMessage()); + } catch (ExecutionException e) { + fail(e.getCause().getMessage()); + } catch (TimeoutException e) { + fail(TIMEOUT_MESSAGE); + } + + for (int i=0; i<2; i++) { + // Wait up to 3 second for the target to suspend. Should happen within 2 seconds. + suspendedEventWaitor.waitForEvent(TestsPlugin.massageTimeout(3000)); + + // Now resume the target and check that we stop at all the breakpoints. + suspendedEventWaitor = new ServiceEventWaitor( + getGDBLaunch().getSession(), + ISuspendedDMEvent.class); + + SyncUtil.resume(); + } + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/MIRunControlTargetAvailableTest_6_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/MIRunControlTargetAvailableTest_6_6.java new file mode 100644 index 00000000000..a0943f7cfb9 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/MIRunControlTargetAvailableTest_6_6.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2011 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson AB - Initial implementation of Test cases + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6; + + +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; +import org.eclipse.cdt.tests.dsf.gdb.tests.MIRunControlTargetAvailableTest; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class MIRunControlTargetAvailableTest_6_6 extends MIRunControlTargetAvailableTest { + @BeforeClass + public static void beforeClassMethod_6_6() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_6); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java index 940afefef53..86c1a814518 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_6_6.java @@ -28,6 +28,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_6_6.class, MIRunControlTest_6_6.class, + MIRunControlTargetAvailableTest_6_6.class, MIExpressionsTest_6_6.class, MIMemoryTest_6_6.class, MIBreakpointsTest_6_6.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java index 71b3d04343b..9a809475196 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_6/Suite_Remote_6_6.java @@ -32,6 +32,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_6_6.class, MIRunControlTest_6_6.class, + MIRunControlTargetAvailableTest_6_6.class, MIExpressionsTest_6_6.class, MIMemoryTest_6_6.class, MIBreakpointsTest_6_6.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/MIRunControlTargetAvailableTest_6_7.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/MIRunControlTargetAvailableTest_6_7.java new file mode 100644 index 00000000000..e38b0a8c3b7 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/MIRunControlTargetAvailableTest_6_7.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2011 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson AB - Initial implementation of Test cases + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7; + + +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6.MIRunControlTargetAvailableTest_6_6; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class MIRunControlTargetAvailableTest_6_7 extends MIRunControlTargetAvailableTest_6_6 { + @BeforeClass + public static void beforeClassMethod_6_7() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_7); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java index dc2c2988b23..075b1c791bf 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_6_7.java @@ -28,6 +28,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_6_7.class, MIRunControlTest_6_7.class, + MIRunControlTargetAvailableTest_6_7.class, MIExpressionsTest_6_7.class, MIMemoryTest_6_7.class, MIBreakpointsTest_6_7.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java index 2ec129981b2..206cb33fc57 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_7/Suite_Remote_6_7.java @@ -32,6 +32,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_6_7.class, MIRunControlTest_6_7.class, + MIRunControlTargetAvailableTest_6_7.class, MIExpressionsTest_6_7.class, MIMemoryTest_6_7.class, MIBreakpointsTest_6_7.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIRunControlTargetAvailableTest_6_8.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIRunControlTargetAvailableTest_6_8.java new file mode 100644 index 00000000000..7346424abe3 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/MIRunControlTargetAvailableTest_6_8.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2011 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson AB - Initial implementation of Test cases + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8; + + +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7.MIRunControlTargetAvailableTest_6_7; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class MIRunControlTargetAvailableTest_6_8 extends MIRunControlTargetAvailableTest_6_7 { + @BeforeClass + public static void beforeClassMethod_6_8() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_6_8); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_6_8.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_6_8.java index af2cb09708f..573788f3ba7 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_6_8.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_6_8.java @@ -28,6 +28,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_6_8.class, MIRunControlTest_6_8.class, + MIRunControlTargetAvailableTest_6_8.class, MIExpressionsTest_6_8.class, MIMemoryTest_6_8.class, MIBreakpointsTest_6_8.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java index 1049657b74b..773df38506e 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_6_8/Suite_Remote_6_8.java @@ -32,6 +32,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_6_8.class, MIRunControlTest_6_8.class, + MIRunControlTargetAvailableTest_6_8.class, MIExpressionsTest_6_8.class, MIMemoryTest_6_8.class, MIBreakpointsTest_6_8.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/MIRunControlTargetAvailableTest_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/MIRunControlTargetAvailableTest_7_0.java new file mode 100644 index 00000000000..894eda4676c --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/MIRunControlTargetAvailableTest_7_0.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2011 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson AB - Initial implementation of Test cases + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0; + + +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8.MIRunControlTargetAvailableTest_6_8; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class MIRunControlTargetAvailableTest_7_0 extends MIRunControlTargetAvailableTest_6_8 { + @BeforeClass + public static void beforeClassMethod_7_0() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_0); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java index 39f7c14bb68..6bf9356ab14 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_7_0.java @@ -28,6 +28,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_7_0.class, MIRunControlTest_7_0.class, + MIRunControlTargetAvailableTest_7_0.class, MIExpressionsTest_7_0.class, MIMemoryTest_7_0.class, MIBreakpointsTest_7_0.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java index 0c77abc4257..177c5c41a36 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_0/Suite_Remote_7_0.java @@ -32,6 +32,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 GDBRemoteTracepointsTest_7_0.class, MIRegistersTest_7_0.class, + MIRunControlTargetAvailableTest_7_0.class, MIRunControlTest_7_0.class, MIExpressionsTest_7_0.class, MIMemoryTest_7_0.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/MIRunControlTargetAvailableTest_7_1.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/MIRunControlTargetAvailableTest_7_1.java new file mode 100644 index 00000000000..0e88623fcbc --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/MIRunControlTargetAvailableTest_7_1.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2011 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson AB - Initial implementation of Test cases + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1; + + +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0.MIRunControlTargetAvailableTest_7_0; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class MIRunControlTargetAvailableTest_7_1 extends MIRunControlTargetAvailableTest_7_0 { + @BeforeClass + public static void beforeClassMethod_7_1() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_1); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java index 916c36891b7..42fae5c0648 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_7_1.java @@ -28,6 +28,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_7_1.class, MIRunControlTest_7_1.class, + MIRunControlTargetAvailableTest_7_1.class, MIExpressionsTest_7_1.class, MIMemoryTest_7_1.class, MIBreakpointsTest_7_1.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java index d766ec427a8..85de71aa447 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_1/Suite_Remote_7_1.java @@ -32,6 +32,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 GDBRemoteTracepointsTest_7_1.class, MIRegistersTest_7_1.class, + MIRunControlTargetAvailableTest_7_1.class, MIRunControlTest_7_1.class, MIExpressionsTest_7_1.class, MIMemoryTest_7_1.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/MIRunControlTargetAvailableTest_7_2.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/MIRunControlTargetAvailableTest_7_2.java new file mode 100644 index 00000000000..f27e4331013 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/MIRunControlTargetAvailableTest_7_2.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2011 Ericsson and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Ericsson AB - Initial implementation of Test cases + *******************************************************************************/ +package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2; + + +import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner; +import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants; +import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_1.MIRunControlTargetAvailableTest_7_1; +import org.junit.BeforeClass; +import org.junit.runner.RunWith; + +@RunWith(BackgroundRunner.class) +public class MIRunControlTargetAvailableTest_7_2 extends MIRunControlTargetAvailableTest_7_1 { + @BeforeClass + public static void beforeClassMethod_7_2() { + setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_2); + } +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java index 2ac0e229d88..06bc8edd9cf 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_7_2.java @@ -28,6 +28,7 @@ import org.junit.runners.Suite; // We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256 MIRegistersTest_7_2.class, MIRunControlTest_7_2.class, + MIRunControlTargetAvailableTest_7_2.class, MIExpressionsTest_7_2.class, MIMemoryTest_7_2.class, MIBreakpointsTest_7_2.class, diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java index 90f96a9cd78..a9f68204ada 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/Suite_Remote_7_2.java @@ -33,6 +33,7 @@ import org.junit.runners.Suite; GDBRemoteTracepointsTest_7_2.class, MIRegistersTest_7_2.class, MIRunControlTest_7_2.class, + MIRunControlTargetAvailableTest_7_2.class, MIExpressionsTest_7_2.class, MIMemoryTest_7_2.class, MIBreakpointsTest_7_2.class,