Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <derodat@adacore.com>
To: GDB Patches <gdb-patches@sourceware.org>
Subject: [PATCH] Share the "multi_line" helper among all Ada testcases
Date: Tue, 10 Mar 2015 11:55:00 -0000	[thread overview]
Message-ID: <54FEDB92.9060808@adacore.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

Hello,

This patch is a tiny cleanup for the Ada testsuite: it put the 
"multi_line" helper (currently defined in 6 testcases) in a common 
place: ada.exp. It triggers no regression (tested on x86_64-linux).

Ok to push?
Thank you in advance,

     gdb/testsuite/ChangeLog:
     2015-03-10  Pierre-Marie de Rodat  <derodat@adacore.com>

         * gdb.ada/complete.exp: Remove "multi_line".
         * gdb.ada/info_exc.exp: Remove "multi_line".
         * gdb.ada/packed_tagged.exp: Remove "multi_line".
         * gdb.ada/ptype_field.exp: Remove "multi_line".
         * gdb.ada/sym_print_name.exp: Remove "multi_line".
         * gdb.ada/tagged.exp: Remove "multi_line".
         * lib/ada.exp: Add the "multi_line" helper.

-- 
Pierre-Marie de Rodat

[-- Attachment #2: 0001-Share-the-multi_line-helper-among-all-Ada-testcases.patch --]
[-- Type: text/x-diff, Size: 6979 bytes --]

From 855c84ea47c0b4f873af31f7cf10b6eefff3f6c2 Mon Sep 17 00:00:00 2001
From: Pierre-Marie de Rodat <derodat@adacore.com>
Date: Tue, 10 Mar 2015 09:51:27 +0100
Subject: [PATCH] Share the "multi_line" helper among all Ada testcases

gdb/testsuite/ChangeLog:
2015-03-10  Pierre-Marie de Rodat  <derodat@adacore.com>

	* gdb.ada/complete.exp: Remove "multi_line".
	* gdb.ada/info_exc.exp: Remove "multi_line".
	* gdb.ada/packed_tagged.exp: Remove "multi_line".
	* gdb.ada/ptype_field.exp: Remove "multi_line".
	* gdb.ada/sym_print_name.exp: Remove "multi_line".
	* gdb.ada/tagged.exp: Remove "multi_line".
	* lib/ada.exp: Add the "multi_line" helper.
---
 gdb/testsuite/gdb.ada/complete.exp       | 10 ----------
 gdb/testsuite/gdb.ada/info_exc.exp       | 11 -----------
 gdb/testsuite/gdb.ada/packed_tagged.exp  | 11 -----------
 gdb/testsuite/gdb.ada/ptype_field.exp    | 11 -----------
 gdb/testsuite/gdb.ada/sym_print_name.exp | 11 -----------
 gdb/testsuite/gdb.ada/tagged.exp         | 11 -----------
 gdb/testsuite/lib/ada.exp                | 11 +++++++++++
 7 files changed, 11 insertions(+), 65 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp
index 1dc9cba..9919bdf 100644
--- a/gdb/testsuite/gdb.ada/complete.exp
+++ b/gdb/testsuite/gdb.ada/complete.exp
@@ -44,16 +44,6 @@ proc test_gdb_no_completion { expr } {
     gdb_test_no_output "complete p $expr"
 }
 
-# A convenience function that joins all the arguments together,
-# with a regexp that matches zero-or-more end of lines in between
-# each argument.  This function is ideal to write the expected output
-# of a GDB command that generates more than a couple of lines, as
-# this allows us to write each line as a separate string, which is
-# easier to read by a human being.
-
-proc multi_line { args } {
-    return [join $args "\[\r\n\]*"]
-}
 # Try a global variable, only one match should be found:
 
 test_gdb_complete "my_glob" \
diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp
index 3f21218..add83c5 100644
--- a/gdb/testsuite/gdb.ada/info_exc.exp
+++ b/gdb/testsuite/gdb.ada/info_exc.exp
@@ -21,17 +21,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
   return -1
 }
 
-# A convenience function that joins all the arguments together,
-# with a regexp that matches zero-or-more end of lines in between
-# each argument.  This function is ideal to write the expected output
-# of a GDB command that generates more than a couple of lines, as
-# this allows us to write each line as a separate string, which is
-# easier to read by a human being.
-
-proc multi_line { args } {
-    return [join $args "\[\r\n\]*"]
-}
-
 clean_restart ${testfile}
 
 if ![runto_main] then {
diff --git a/gdb/testsuite/gdb.ada/packed_tagged.exp b/gdb/testsuite/gdb.ada/packed_tagged.exp
index 02e02ea..4187702 100644
--- a/gdb/testsuite/gdb.ada/packed_tagged.exp
+++ b/gdb/testsuite/gdb.ada/packed_tagged.exp
@@ -21,17 +21,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
   return -1
 }
 
-# A convenience function that joins all the arguments together,
-# with a regexp that matches zero-or-more end of lines in between
-# each argument.  This function is ideal to write the expected output
-# of a GDB command that generates more than a couple of lines, as
-# this allows us to write each line as a separate string, which is
-# easier to read by a human being.
-
-proc multi_line { args } {
-    return [join $args "\[\r\n\]*"]
-}
-
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/comp_bug.adb]
diff --git a/gdb/testsuite/gdb.ada/ptype_field.exp b/gdb/testsuite/gdb.ada/ptype_field.exp
index caf99ba..b4eb8f6 100644
--- a/gdb/testsuite/gdb.ada/ptype_field.exp
+++ b/gdb/testsuite/gdb.ada/ptype_field.exp
@@ -21,17 +21,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional
   return -1
 }
 
-# A convenience function that joins all the arguments together,
-# with a regexp that matches zero-or-more end of lines in between
-# each argument.  This function is ideal to write the expected output
-# of a GDB command that generates more than a couple of lines, as
-# this allows us to write each line as a separate string, which is
-# easier to read by a human being.
-
-proc multi_line { args } {
-    return [join $args "\[\r\n\]*"]
-}
-
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
diff --git a/gdb/testsuite/gdb.ada/sym_print_name.exp b/gdb/testsuite/gdb.ada/sym_print_name.exp
index c78793e..f942fdf 100644
--- a/gdb/testsuite/gdb.ada/sym_print_name.exp
+++ b/gdb/testsuite/gdb.ada/sym_print_name.exp
@@ -21,17 +21,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
   return -1
 }
 
-# A convenience function that joins all the arguments together,
-# with a regexp that matches zero-or-more end of lines in between
-# each argument.  This function is ideal to write the expected output
-# of a GDB command that generates more than a couple of lines, as
-# this allows us to write each line as a separate string, which is
-# easier to read by a human being.
-
-proc multi_line { args } {
-    return [join $args "\[\r\n\]*"]
-}
-
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb]
diff --git a/gdb/testsuite/gdb.ada/tagged.exp b/gdb/testsuite/gdb.ada/tagged.exp
index 9f40a96..f428148 100644
--- a/gdb/testsuite/gdb.ada/tagged.exp
+++ b/gdb/testsuite/gdb.ada/tagged.exp
@@ -21,17 +21,6 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" }
   return -1
 }
 
-# A convenience function that joins all the arguments together,
-# with a regexp that matches zero-or-more end of lines in between
-# each argument.  This function is ideal to write the expected output
-# of a GDB command that generates more than a couple of lines, as
-# this allows us to write each line as a separate string, which is
-# easier to read by a human being.
-
-proc multi_line { args } {
-    return [join $args "\[\r\n\]*"]
-}
-
 clean_restart ${testfile}
 
 set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index 6a1e192..903ef45 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -60,3 +60,14 @@ proc standard_ada_testfile {base_file {dir ""}} {
 
     file mkdir [standard_output_file $testdir]
 }
+
+# A convenience function that joins all the arguments together,
+# with a regexp that matches zero-or-more end of lines in between
+# each argument.  This function is ideal to write the expected output
+# of a GDB command that generates more than a couple of lines, as
+# this allows us to write each line as a separate string, which is
+# easier to read by a human being.
+
+proc multi_line { args } {
+    return [join $args "\[\r\n\]*"]
+}
-- 
2.3.1


             reply	other threads:[~2015-03-10 11:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 11:55 Pierre-Marie de Rodat [this message]
2015-03-17 20:08 ` Joel Brobecker
2015-03-18  9:45   ` Pedro Alves
2015-03-18 14:12     ` Joel Brobecker
2015-03-20 12:18       ` Pierre-Marie de Rodat
2015-03-20 18:00         ` Pedro Alves
2015-04-01  8:50           ` Pierre-Marie de Rodat
2015-04-01 10:26             ` Pedro Alves
2015-04-01 13:08               ` Pierre-Marie de Rodat
2015-07-18  0:35         ` Sergio Durigan Junior
2015-07-20 14:49           ` Pierre-Marie de Rodat
2015-07-20 15:35             ` Sergio Durigan Junior
2015-07-20 22:23               ` Joel Brobecker
2015-07-20 22:42                 ` Sergio Durigan Junior

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=54FEDB92.9060808@adacore.com \
    --to=derodat@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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