public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, testsuite] Update gdb startup text in selftest.exp
@ 2018-06-12 14:10 Tom de Vries
  2018-06-13 11:50 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2018-06-12 14:10 UTC (permalink / raw)
  To: gdb-patches, Tom Tromey

Hi,

atm selftest.exp fails for me.

One of the reasons is that in c61b06a19a34baab66e3809c7b41b0c31009ed9f (Remove
some text from --version output) an eol was added after "There is NO
WARRANTY, to the extent permitted by law".

This patch updates the matching of the gdb startup message in selftest.exp
accordingly.

Tested selftest.exp (with two other selftest.exp related fixes applied).

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Update gdb startup text in selftest.exp

2018-06-12  Tom de Vries  <tdevries@suse.de>

	* gdb.gdb/selftest.exp (test_with_self): Update gdb startup text.

---
 gdb/testsuite/gdb.gdb/selftest.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 20f34983ef..314bddb8bf 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -66,7 +66,7 @@ proc test_with_self { } {
 	set test "xgdb is at prompt"
 	gdb_test_multiple "continue" $test {
 	    -i "$inferior_spawn_id"
-	    -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc.*License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.*This is free software: you are free to change and redistribute it.*There is NO WARRANTY, to the extent permitted by law.  Type \"show copying\".*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" {
+	    -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc.*License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.*This is free software: you are free to change and redistribute it.*There is NO WARRANTY, to the extent permitted by law\..*Type \"show copying\".*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" {
 		pass $test
 	    }
 	}

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

* Re: [PATCH, testsuite] Update gdb startup text in selftest.exp
  2018-06-12 14:10 [PATCH, testsuite] Update gdb startup text in selftest.exp Tom de Vries
@ 2018-06-13 11:50 ` Pedro Alves
  2018-06-14 11:51   ` [pushed] gdb.gdb/selftest.exp, Use multi_line to build gdb's expected startup output (Re: [PATCH, testsuite] Update gdb startup text in selftest.exp) Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2018-06-13 11:50 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches, Tom Tromey

[Tromey's current address fixed]

Hi Tom,

On 06/12/2018 03:10 PM, Tom de Vries wrote:
> Hi,
> 
> atm selftest.exp fails for me.
> 
> One of the reasons is that in c61b06a19a34baab66e3809c7b41b0c31009ed9f (Remove
> some text from --version output) an eol was added after "There is NO
> WARRANTY, to the extent permitted by law".
> 
> This patch updates the matching of the gdb startup message in selftest.exp
> accordingly.
> 
> Tested selftest.exp (with two other selftest.exp related fixes applied).
> 
> OK for trunk?
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Update gdb startup text in selftest.exp

You were probably already going to do it, but just in case,
since it's not practice in gcc, please include the rationale above
in the commit log (without the "Hi", "OK for trunk", etc.
bits of course.)  See "git log gdb/" for examples.

OK with that change.

That test could be made a lot more readable with use of multi_line.

Thanks,
Pedro Alves

> 
> 2018-06-12  Tom de Vries  <tdevries@suse.de>
> 
> 	* gdb.gdb/selftest.exp (test_with_self): Update gdb startup text.
> 
> ---
>  gdb/testsuite/gdb.gdb/selftest.exp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
> index 20f34983ef..314bddb8bf 100644
> --- a/gdb/testsuite/gdb.gdb/selftest.exp
> +++ b/gdb/testsuite/gdb.gdb/selftest.exp
> @@ -66,7 +66,7 @@ proc test_with_self { } {
>  	set test "xgdb is at prompt"
>  	gdb_test_multiple "continue" $test {
>  	    -i "$inferior_spawn_id"
> -	    -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc.*License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.*This is free software: you are free to change and redistribute it.*There is NO WARRANTY, to the extent permitted by law.  Type \"show copying\".*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" {
> +	    -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc.*License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.*This is free software: you are free to change and redistribute it.*There is NO WARRANTY, to the extent permitted by law\..*Type \"show copying\".*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" {
>  		pass $test
>  	    }
>  	}
> 

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

* [pushed] gdb.gdb/selftest.exp, Use multi_line to build gdb's expected startup output (Re: [PATCH, testsuite] Update gdb startup text in selftest.exp)
  2018-06-13 11:50 ` Pedro Alves
@ 2018-06-14 11:51   ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2018-06-14 11:51 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches, Tom Tromey

On 06/13/2018 12:49 PM, Pedro Alves wrote:

> That test could be made a lot more readable with use of multi_line.

I've pushed this in.

From 11ae5818f76e0af4dcf7ee069e0756ccf6901ebe Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Thu, 14 Jun 2018 12:25:41 +0100
Subject: [PATCH] gdb.gdb/selftest.exp, Use multi_line to build gdb's expected
 startup output

This regex had to be touched at least twice these past few days.  Use
multi_line to make it more readable.

Note this also tightens the regex a little bit in some spots.

gdb/testsuite/ChangeLog:
2018-06-14  Pedro Alves  <palves@redhat.com>

	* gdb.gdb/selftest.exp (test_with_self): Use multi_line to build
	gdb's expected startup output.
---
 gdb/testsuite/ChangeLog            |  5 +++++
 gdb/testsuite/gdb.gdb/selftest.exp | 11 ++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fd6b8fcbf2f..aa568a8343f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-14  Pedro Alves  <palves@redhat.com>
+
+	* gdb.gdb/selftest.exp (test_with_self): Use multi_line to build
+	gdb's expected startup output.
+
 2018-06-14  Pedro Alves  <palves@redhat.com>
 
 	* lib/selftest-support.exp (selftest_setup): Remove inlined
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 314bddb8bf2..3b200a28c53 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -63,10 +63,19 @@ proc test_with_self { } {
 	# Wait a bit while the inferior gdb gets to its prompt.
 	sleep 1
     } else {
+	set banner [multi_line \
+			"GNU gdb \[0-9\.\]*\[^\r\n\]*" \
+			"Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc\." \
+			"License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>" \
+			"This is free software: you are free to change and redistribute it\." \
+			"There is NO WARRANTY, to the extent permitted by law\." \
+			"Type \"show copying\" and \"show warranty\" for details\." \
+			"This GDB was configured as .*" \
+			"$gdb_prompt $"]
 	set test "xgdb is at prompt"
 	gdb_test_multiple "continue" $test {
 	    -i "$inferior_spawn_id"
-	    -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Foundation, Inc.*License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.*This is free software: you are free to change and redistribute it.*There is NO WARRANTY, to the extent permitted by law\..*Type \"show copying\".*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" {
+	    -re "$banner" {
 		pass $test
 	    }
 	}
-- 
2.14.3

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

end of thread, other threads:[~2018-06-14 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12 14:10 [PATCH, testsuite] Update gdb startup text in selftest.exp Tom de Vries
2018-06-13 11:50 ` Pedro Alves
2018-06-14 11:51   ` [pushed] gdb.gdb/selftest.exp, Use multi_line to build gdb's expected startup output (Re: [PATCH, testsuite] Update gdb startup text in selftest.exp) Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).