From 806a0e65a4820069b7e5932247193240ba0b7127 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 24 Dec 2014 11:38:52 -0500 Subject: [PATCH] Disable LaunchConfigurationAndRestartTest.testSourceGdbInit for gdb < 7.2 When executing the launch sequence in testSourceGdbInit, gdb 7.1 inserts an extraneous \n in one of its replies, causing an assert to be hit. Since we don't actively support that version, let's just disable the test. Change-Id: I9544835ead72e1701766d76fafa0e63f3b88911d Signed-off-by: Simon Marchi Reviewed-on: https://git.eclipse.org/r/38768 Reviewed-by: Marc Khouzam Tested-by: Marc Khouzam --- .../LaunchConfigurationAndRestartTest.java | 17 +++++++++++++--- ...LaunchConfigurationAndRestartTest_7_2.java | 20 ++++++++++++++++++- 2 files changed, 33 insertions(+), 4 deletions(-) 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 d618328c95e..e2ecf6bf6ef 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 @@ -4,10 +4,11 @@ * 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 - Initial Implementation * Simon Marchi (Ericsson) - Remove a catch that just fails a test. + * Simon Marchi (Ericsson) - Disable tests for gdb < 7.2. *******************************************************************************/ package org.eclipse.cdt.tests.dsf.gdb.tests; @@ -209,8 +210,17 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase { * as the gdbinit file. We then verify the that the content was properly read. * launchConfigTestGdbinit will simply set some arguments for the program to read; * the arguments are "1 2 3 4 5 6". - */ + * + * This test is disabled for gdb.7.1 because gdb inserts an extraneous \n that messes up + * the launch sequence (more particularly, the byte length detection): + * + * 17-interpreter-exec console "p/x (char)-1" + * ~"\n" + * ~"$1 = 0xff\n" + * 17^done + */ @Test + @Ignore public void testSourceGdbInit() throws Throwable { setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, "data/launch/src/launchConfigTestGdbinit"); @@ -269,6 +279,7 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase { * Repeat the test testSourceGdbInit, but after a restart. */ @Test + @Ignore public void testSourceGdbInitRestart() throws Throwable { fRestart = true; testSourceGdbInit(); @@ -694,4 +705,4 @@ public class LaunchConfigurationAndRestartTest extends BaseTestCase { } -} \ No newline at end of file +} diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/LaunchConfigurationAndRestartTest_7_2.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/LaunchConfigurationAndRestartTest_7_2.java index 9d301c8b3f8..b7f5d16410f 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/LaunchConfigurationAndRestartTest_7_2.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_2/LaunchConfigurationAndRestartTest_7_2.java @@ -7,7 +7,7 @@ * * Contributors: * Ericsson - Initial Implementation - * Simon Marchi (Ericsson) - Disable some reverse tests for gdb 7.0 and 7.1. + * Simon Marchi (Ericsson) - Disable some tests for gdb < 7.2. *******************************************************************************/ package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_2; @@ -59,4 +59,22 @@ public class LaunchConfigurationAndRestartTest_7_2 extends LaunchConfigurationAn public void testStopAtOtherWithReverseRestart() throws Throwable { super.testStopAtOtherWithReverseRestart(); } + + /** + * Enable the test for gdb 7.2 and upwards. + */ + @Test + @Override + public void testSourceGdbInit() throws Throwable { + super.testSourceGdbInit(); + } + + /** + * Enable the test for gdb 7.2 and upwards. + */ + @Test + @Override + public void testSourceGdbInitRestart() throws Throwable { + super.testSourceGdbInitRestart(); + } }