Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa/testsuite/mi] Fix transient failures in mi*-hack-cli.exp
@ 2001-09-28 15:47 Daniel Jacobowitz
  2001-10-01  7:57 ` Fernando Nasser
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2001-09-28 15:47 UTC (permalink / raw)
  To: gdb-patches

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"
 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-10-28 10:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-28 15:47 [rfa/testsuite/mi] Fix transient failures in mi*-hack-cli.exp Daniel Jacobowitz
2001-10-01  7:57 ` Fernando Nasser
2001-10-01  8:33   ` Andrew Cagney
     [not found]     ` <3BCA222A.2050601@cygnus.com>
2001-10-14 16:47       ` Daniel Jacobowitz
2001-10-27 17:31         ` Daniel Jacobowitz
2001-10-28 10:01         ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox