Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: <gdb@sources.redhat.com>
Subject: [MI/testsuite] mi_gdb_test: expected result priority?
Date: Mon, 24 Jun 2002 12:46:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.33.0206241238300.24067-100000@makita.cygnus.com> (raw)

Hi,

I've been writing some MI tests for all the stuff that I've been adding,
and I ran across an anomaly...

When mi_gdb_test actually calls expect, it does:

    gdb_expect $tmt {
	 -re "\\*\\*\\* DOSEXIT code.*" {
	     if { $message != "" } {
		 fail "$message";
	     }
	     gdb_suppress_entire_file "GDB died";
	     return -1;
	 }
	 -re "Ending remote debugging.*$mi_gdb_prompt\[ \]*$" {
	    if ![isnative] then {
		warning "Can`t communicate to remote target."
	    }
	    gdb_exit
	    gdb_start
	    set result -1
	}
	 -re "(${question_string})$" {
	    send_gdb "$response_string\n";
	    exp_continue;
	}
	 -re "Undefined.* command:.*$mi_gdb_prompt\[ \]*$" {
	    perror "Undefined command \"$command\"."
            fail "$message"
	    set result 1
	}
	 -re "Ambiguous command.*$mi_gdb_prompt\[ \]*$" {
	    perror "\"$command\" is not a unique command name."
            fail "$message"
	    set result 1
	}
	 -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" {
	    if ![string match "" $message] then {
		pass "$message"
	    }
	    set result 0
	}


The astute reader will notice that the _real_ expected pattern by the
caller is pre-empted by several other patterns. Therefore if one wanted to
write a test to check for the string "Ambiguous command", well, you'd
automatically get a fail. Likewise, if you wanted to write a test that
checked for the string "Undefined command: \"bogus\".  Try \"help\"."
(which I am trying to do), one is screwed.

Is there any particular reason to not move the real expected result
pattern higher in the list (like to/near the top or something)??

Keith


             reply	other threads:[~2002-06-24 19:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-24 12:46 Keith Seitz [this message]
2002-06-24 13:20 ` Elena Zannoni
2002-06-24 14:04 ` Torubles with remote stub for m68k Peter Barada
2002-06-24 14:13   ` Daniel Jacobowitz
2002-06-24 14:40     ` Peter Barada
2002-06-24 14:56       ` Peter Barada
2002-06-24 15:07         ` Daniel Jacobowitz
2002-06-24 15:30           ` Andrew Cagney
2002-06-24 15:35             ` Quality Quorum
2002-06-25  7:53             ` Peter Barada
2002-06-25 10:44               ` Andrew Cagney
2002-06-25  9:38                 ` Peter Barada
2002-06-25 13:28                   ` Andrew Cagney
2002-06-25 10:02                 ` Daniel Jacobowitz
2002-06-25  8:13           ` Peter Barada
2002-06-25  8:17             ` Daniel Jacobowitz
2002-06-25  8:32               ` Peter Barada
2002-06-25  8:40                 ` Daniel Jacobowitz
2002-06-25 13:43   ` Andrew Cagney

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=Pine.GSO.4.33.0206241238300.24067-100000@makita.cygnus.com \
    --to=keiths@redhat.com \
    --cc=gdb@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