Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: gdb.base/completion.exp - simplify with gdb_test_multiple
Date: Wed, 04 May 2011 14:42:00 -0000	[thread overview]
Message-ID: <201105041542.25980.pedro@codesourcery.com> (raw)
In-Reply-To: <20110504142038.GA20147@host1.jankratochvil.net>

On Wednesday 04 May 2011 15:20:38, Jan Kratochvil wrote:
> On Tue, 03 May 2011 17:33:22 +0200, Pedro Alves wrote:
> > Anyone feel like taking a look at this?  I tested this with and
> > without Jan's read1 hack from PR testsuite/12649.
> [...]
> > --- src.orig/gdb/testsuite/lib/gdb.exp	2011-05-02 16:33:33.709463001 +0100
> > +++ src/gdb/testsuite/lib/gdb.exp	2011-05-03 00:20:33.159462999 +0100
> > @@ -593,7 +593,7 @@ proc gdb_test_multiple { command message
> >  	set message $command
> >      }
> >  
> > -    if [string match "*\[\r\n\]" $command] {
> > +    if { $command != "" && [string match "*\[\r\n\]" $command] } {
> >  	error "Invalid trailing newline in \"$message\" test"
> >      }
> >  
> 
> This part should be dropped as it has no effect and it is not needed.

Huh, indeed.  Done, and committed.

> 
> Attached patch either to commit on top of it or integrate it, I do not mind.

Nice, go ahead, thanks.

> 
> 
> Thanks,
> Jan
> 
> 
> gdb/
> 2011-05-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* gdb.base/completion.exp (complete help info wat): Rename to ...
> 	(complete 'help info wat'): ... here.
> 	Remove all `-re ".*' and `-re "^.*' redundant regexes.
> 	(complete 'p 'arg', complete (2) 'p 'arg'): Remove redundant backslash.
> 
> --- a/gdb/testsuite/gdb.base/completion.exp
> +++ b/gdb/testsuite/gdb.base/completion.exp
> @@ -270,7 +270,7 @@ gdb_test_multiple "" "$test" {
>      }
>  }
>  
> -set test "complete help info wat"
> +set test "complete 'help info wat'"
>  send_gdb "help info wat\t"
>  gdb_test_multiple "" "$test" {
>      -re "^help info watchpoints $" {
> @@ -296,7 +296,7 @@ gdb_test_multiple "" "$test" {
>      -re "^p \"break1\\.c\"$" {
>  	send_gdb "\n"
>  	gdb_test_multiple "" "$test" {
> -	    -re ".*$gdb_prompt $" {
> +	    -re "$gdb_prompt $" {
>  		pass "$test"
>  	    }
>  	}
> @@ -314,7 +314,7 @@ gdb_test_multiple "" "$test" {
>      -re "^p \"break1\\.c\"$" {
>  	send_gdb "\n"
>  	gdb_test_multiple "" "$test" {
> -	    -re ".*$gdb_prompt $" {
> +	    -re "$gdb_prompt $" {
>  		pass "$test"
>  	    }
>  	}
> @@ -325,7 +325,7 @@ gdb_test_multiple "" "$test" {
>      }
>  }
>  
> -set test "complete 'p \'arg'"
> +set test "complete 'p 'arg'"
>  send_gdb "p 'arg\t"
>  gdb_test_multiple "" "$test" {
>      -re "^p 'arg\\\x07$" {
> @@ -338,13 +338,13 @@ gdb_test_multiple "" "$test" {
>      }
>  }
>  
> -set test "complete (2) 'p \'arg'"
> +set test "complete (2) 'p 'arg'"
>  send_gdb "p 'arg\t"
>  gdb_test_multiple "" "$test" {
>      -re "^p 'arg\\\x07$" {
>  	send_gdb "\t"
>  	gdb_test_multiple "" "$test" {
> -	    -re ".*argv.*$gdb_prompt " {
> +	    -re "argv.*$gdb_prompt " {
>  		send_gdb "\n"
>  		gdb_test_multiple "" "$test" {
>  		    -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
> @@ -411,7 +411,7 @@ gdb_test_multiple "" "$test" {
>      -re "^p no_var_named_this-arg\\\x07$" {
>  	send_gdb "\t"
>  	gdb_test_multiple "" "$test" {
> -	    -re ".*argv.*$gdb_prompt " {
> +	    -re "argv.*$gdb_prompt " {
>  		send_gdb "\n"
>  		gdb_test_multiple "" "$test" {
>  		    -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
> @@ -467,7 +467,7 @@ gdb_test_multiple "" "$test" {
>  		    }
>  		}
>  	    }
> -	    -re ".*argv.*$gdb_prompt $" {
> +	    -re "argv.*$gdb_prompt $" {
>  		send_gdb "\n"
>  		gdb_test_multiple "" "$test" {
>  		    -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
> @@ -485,7 +485,7 @@ gdb_test_multiple "" "$test" {
>      -re "^p values.0..a_field $" {
>  	send_gdb "\n"
>  	gdb_test_multiple "" "$test" {
> -	    -re "^.* = 0.*$gdb_prompt $" {
> +	    -re " = 0.*$gdb_prompt $" {
>  		pass "$test"
>  	    }
>  	}
> @@ -498,7 +498,7 @@ gdb_test_multiple "" "$test" {
>      -re "^p values.0. . a_field $" {
>  	send_gdb "\n"
>  	gdb_test_multiple "" "$test" {
> -	    -re "^.* = 0.*$gdb_prompt $" {
> +	    -re " = 0.*$gdb_prompt $" {
>  		pass "$test"
>  	    }
>  	}
> @@ -511,7 +511,7 @@ gdb_test_multiple "" "$test" {
>      -re "^p &values.0. -> a_field $" {
>  	send_gdb "\n"
>  	gdb_test_multiple "" "$test" {
> -	    -re "^.* = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $" {
> +	    -re " = .*0x\[0-9a-fA-F\]*.*$gdb_prompt $" {
>  		pass "$test"
>  	    }
>  	}
> @@ -608,7 +608,7 @@ gdb_test_multiple "" "$test" {
>  		send_gdb "n\n"
>  		exp_continue
>  	    }
> -	    -re ".*$gdb_prompt $" {
> +	    -re "$gdb_prompt $" {
>  		pass "$test"
>  	    }
>  	}
> 

-- 
Pedro Alves


  reply	other threads:[~2011-05-04 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 15:33 Pedro Alves
2011-05-04 14:21 ` Jan Kratochvil
2011-05-04 14:42   ` Pedro Alves [this message]
2011-05-04 14:46     ` Jan Kratochvil

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=201105041542.25980.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@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