This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[rfa/testsuite/mi] Fix transient failures in mi*-hack-cli.exp
- To: gdb-patches at sources dot redhat dot com
- Subject: [rfa/testsuite/mi] Fix transient failures in mi*-hack-cli.exp
- From: Daniel Jacobowitz <drow at mvista dot com>
- Date: Fri, 28 Sep 2001 18:47:55 -0400
This one was a real nuisance to find...
mi_gdb_test expects strings without the trailing newline. If there is a
trailing newline, we'll get two prompts back. In some cases, depending on
the delicacy of timing, this can cause a problem. The output looks like:
47show architecture
&"show architecture\n"
~"The target architecture is assumed to be i386\n"
47^done
(gdb)
&"\n"
^done
(gdb)
As best I can tell, this hits a bug (feature?) in the regular expression
matcher involving greedy matches. The .*" sequence in the test matches from
the beginning of ' is assumed' all the way down to the second '&"\n"'. Thus
the ^done bit does not match successfully.
Removing the unnecessary newlines masks the bug, as best as my tests can
tell. OK to commit?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2001-09-28 Daniel Jacobowitz <drow@mvista.com>
* gdb.mi/mi-hack-cli.exp: Remove excess newlines from test strings.
* gdm.mi/mi0-hack-cli.exp: Likewise.
Index: gdb.mi/mi-hack-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-hack-cli.exp,v
retrieving revision 1.4
diff -u -r1.4 mi-hack-cli.exp
--- mi-hack-cli.exp 2001/06/23 21:47:09 1.4
+++ mi-hack-cli.exp 2001/09/28 22:38:46
@@ -28,11 +28,11 @@
continue
}
-mi_gdb_test "show architecture\n" \
+mi_gdb_test "show architecture" \
"&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n\\^done" \
"show architecture"
-mi_gdb_test "47show architecture\n" \
+mi_gdb_test "47show architecture" \
"&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n47\\^done" \
"47show architecture"
Index: gdb.mi/mi0-hack-cli.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-hack-cli.exp,v
retrieving revision 1.3
diff -u -r1.3 mi0-hack-cli.exp
--- mi0-hack-cli.exp 2001/06/23 21:47:09 1.3
+++ mi0-hack-cli.exp 2001/09/28 22:38:46
@@ -28,11 +28,11 @@
continue
}
-mi_gdb_test "show architecture\n" \
+mi_gdb_test "show architecture" \
"&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n\\^done" \
"show architecture"
-mi_gdb_test "47show architecture\n" \
+mi_gdb_test "47show architecture" \
"&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n47\\^done" \
"47show architecture"