Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: [rfa/testsuite/mi] Fix transient failures in mi*-hack-cli.exp
Date: Fri, 28 Sep 2001 15:47:00 -0000	[thread overview]
Message-ID: <20010928184755.A24096@nevyn.them.org> (raw)

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"
 


             reply	other threads:[~2001-09-28 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-28 15:47 Daniel Jacobowitz [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010928184755.A24096@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox