From b7277f86f08729981e41c6cc3d70916ccb83a650 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Sun, 13 Jan 2013 21:40:48 -0500 Subject: [PATCH] Bug 378834 - Improved tests printouts for Hudson build. Change-Id: I027c6615e4974f8bf076955c0e7c02fc33381df1 --- .../cdt/tests/dsf/gdb/framework/BaseTestCase.java | 11 ++++++----- .../cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java | 14 +++++++------- .../cdt/tests/dsf/gdb/tests/MICatchpointsTest.java | 10 +++++----- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java index c86d48d1e0e..9ffcf2484ac 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 @@ -21,6 +21,7 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.dsf.datamodel.IDMEvent; import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent; import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; +import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; import org.eclipse.cdt.dsf.mi.service.command.events.IMIDMEvent; import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent; @@ -218,10 +219,10 @@ public class BaseTestCase { protected void doLaunch() throws Exception { boolean remote = launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE).equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE); - System.out.println("===================================================================================================="); - System.out.println(String.format("Running test: %s using GDB: %s remote %s", - testName.getMethodName(), launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME), remote ? "on" : "off")); - System.out.println("===================================================================================================="); + GdbPlugin.debug("===============================================================================================\n"); + System.out.println(String.format("%s \"%s\" launching %s %s", + GdbPlugin.getDebugTime(), testName.getMethodName(), launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME), remote ? "with gdbserver" : "")); + GdbPlugin.debug("===============================================================================================\n"); boolean postMortemLaunch = launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE) .equals(ICDTLaunchConfigurationConstants.DEBUGGER_MODE_CORE); @@ -320,7 +321,7 @@ public class BaseTestCase { BufferedReader reader = new BufferedReader(r); String line; while ((line = reader.readLine()) != null) { - System.out.println(line); + GdbPlugin.debug(line + "\n"); line = line.trim(); if (line.startsWith("Listening on port")) { break; 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 37dee117646..b2c4307e656 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 @@ -37,7 +37,7 @@ import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContex import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData; import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext; -import org.eclipse.cdt.dsf.internal.DsfPlugin; +import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData; import org.eclipse.cdt.dsf.mi.service.MIBreakpoints; import org.eclipse.cdt.dsf.mi.service.MIBreakpoints.MIBreakpointDMContext; @@ -240,7 +240,7 @@ public class MIBreakpointsTest extends BaseTestCase { @DsfServiceEventHandler public void eventDispatched(IBreakpointsAddedEvent e) { synchronized (lock) { - System.out.println(DsfPlugin.getDebugTime() + " Got bp added event"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp added event\n"); fBreakpointEvents[BP_ADDED]++; fBreakpointEventCount++; fBreakpointRef = ((MIBreakpointDMContext) e.getBreakpoints()[0]).getReference(); @@ -251,7 +251,7 @@ public class MIBreakpointsTest extends BaseTestCase { @DsfServiceEventHandler public void eventDispatched(IBreakpointsUpdatedEvent e) { synchronized (lock) { - System.out.println(DsfPlugin.getDebugTime() + " Got bp updated event"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp updated event\n"); fBreakpointEvents[BP_UPDATED]++; fBreakpointEventCount++; fBreakpointRef = ((MIBreakpointDMContext) e.getBreakpoints()[0]).getReference(); @@ -262,7 +262,7 @@ public class MIBreakpointsTest extends BaseTestCase { @DsfServiceEventHandler public void eventDispatched(IBreakpointsRemovedEvent e) { synchronized (lock) { - System.out.println(DsfPlugin.getDebugTime() + " Got bp removed event"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp removed event\n"); fBreakpointEvents[BP_REMOVED]++; fBreakpointEventCount++; fBreakpointRef = ((MIBreakpointDMContext) e.getBreakpoints()[0]).getReference(); @@ -273,7 +273,7 @@ public class MIBreakpointsTest extends BaseTestCase { @DsfServiceEventHandler public void eventDispatched(MIBreakpointHitEvent e) { synchronized (lock) { - System.out.println(DsfPlugin.getDebugTime() + " Got bp hit event"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp hit event\n"); fBreakpointEvents[BP_HIT]++; fBreakpointEventCount++; fBreakpointRef = e.getNumber(); @@ -284,7 +284,7 @@ public class MIBreakpointsTest extends BaseTestCase { @DsfServiceEventHandler public void eventDispatched(MIWatchpointTriggerEvent e) { synchronized (lock) { - System.out.println(DsfPlugin.getDebugTime() + " Got wp hit event"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got wp hit event\n"); fBreakpointEvents[WP_HIT]++; fBreakpointEventCount++; fBreakpointRef = e.getNumber(); @@ -295,7 +295,7 @@ public class MIBreakpointsTest extends BaseTestCase { @DsfServiceEventHandler public void eventDispatched(MIWatchpointScopeEvent e) { synchronized (lock) { - System.out.println(DsfPlugin.getDebugTime() + " Got wp scope event"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got wp scope event\n"); fBreakpointEvents[WP_OOS]++; fBreakpointEventCount++; fBreakpointRef = e.getNumber(); 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 b205d223238..2bccfff562f 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 @@ -43,7 +43,7 @@ import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContex import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData; import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext; -import org.eclipse.cdt.dsf.internal.DsfPlugin; +import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin; import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData; import org.eclipse.cdt.dsf.mi.service.MIBreakpoints; import org.eclipse.cdt.dsf.mi.service.MIBreakpoints.MIBreakpointDMContext; @@ -225,7 +225,7 @@ public class MICatchpointsTest extends BaseTestCase { synchronized (fEventHandlerLock) { fBreakpointEvents[BP_ADDED]++; fBreakpointRef = ((MIBreakpointDMContext) e.getBreakpoints()[0]).getReference(); - System.out.println(DsfPlugin.getDebugTime() + " Got bp added event (#" + fBreakpointRef + ")"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp added event (#" + fBreakpointRef + ")\n"); fEventHandlerLock.notifyAll(); } } @@ -235,7 +235,7 @@ public class MICatchpointsTest extends BaseTestCase { synchronized (fEventHandlerLock) { fBreakpointEvents[BP_UPDATED]++; fBreakpointRef = ((MIBreakpointDMContext) e.getBreakpoints()[0]).getReference(); - System.out.println(DsfPlugin.getDebugTime() + " Got bp updated event (#" + fBreakpointRef + ")"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp updated event (#" + fBreakpointRef + ")\n"); fEventHandlerLock.notifyAll(); } } @@ -245,7 +245,7 @@ public class MICatchpointsTest extends BaseTestCase { synchronized (fEventHandlerLock) { fBreakpointEvents[BP_REMOVED]++; fBreakpointRef = ((MIBreakpointDMContext) e.getBreakpoints()[0]).getReference(); - System.out.println(DsfPlugin.getDebugTime() + " Got bp removed event (#" + fBreakpointRef + ")"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp removed event (#" + fBreakpointRef + ")\n"); fEventHandlerLock.notifyAll(); } } @@ -255,7 +255,7 @@ public class MICatchpointsTest extends BaseTestCase { synchronized (fEventHandlerLock) { fBreakpointEvents[BP_HIT]++; fBreakpointRef = e.getNumber(); - System.out.println(DsfPlugin.getDebugTime() + " Got bp hit event (#" + fBreakpointRef + ")"); + GdbPlugin.debug(GdbPlugin.getDebugTime() + " Got bp hit event (#" + fBreakpointRef + ")\n"); fEventHandlerLock.notifyAll(); } }