Share the "multi_line" helper among all Ada testcases

Message ID 20150720222317.GH7406@adacore.com
State New, archived
Headers

Commit Message

Joel Brobecker July 20, 2015, 10:23 p.m. UTC
  > > --- a/gdb/testsuite/gdb.ada/info_exc.exp
> > +++ b/gdb/testsuite/gdb.ada/info_exc.exp
> > @@ -34,9 +34,7 @@ gdb_test "info exceptions" \
> >                  "program_error: $hex" \
> >                  "storage_error: $hex" \
> >                  "tasking_error: $hex" \
> > -                ".*" \
> > -                "const.aint_global_gdb_e: $hex" \
> > -                ".*"]
> > +                "\(.*\r\n\)*const.aint_global_gdb_e: $hex\(.*\r\n\)*"]
> >
> >  gdb_test "info exceptions task" \
> >      [multi_line "All Ada exceptions matching regular expression
> > \"task\":" \

I missed that answer, and came up with something very similar,
which I checked in. Here it is:

gdb/testsuite/ChangeLog:

        * gdb.ada/info_exc.exp: Adjust "info exceptions" expected output.

Tested on x86_64-linux.

I thought about using join directly with the relaxed end-of-line
sequence to restore the original behavior, but then decided against
it, because this expected output is stricter, and I think that's
better. So I came up with the attached patch, which is another way
of doing what Pierre Marie had done.
  

Comments

Sergio Durigan Junior July 20, 2015, 10:42 p.m. UTC | #1
On Monday, July 20 2015, Joel Brobecker wrote:

>> > --- a/gdb/testsuite/gdb.ada/info_exc.exp
>> > +++ b/gdb/testsuite/gdb.ada/info_exc.exp
>> > @@ -34,9 +34,7 @@ gdb_test "info exceptions" \
>> >                  "program_error: $hex" \
>> >                  "storage_error: $hex" \
>> >                  "tasking_error: $hex" \
>> > -                ".*" \
>> > -                "const.aint_global_gdb_e: $hex" \
>> > -                ".*"]
>> > +                "\(.*\r\n\)*const.aint_global_gdb_e: $hex\(.*\r\n\)*"]
>> >
>> >  gdb_test "info exceptions task" \
>> >      [multi_line "All Ada exceptions matching regular expression
>> > \"task\":" \
>
> I missed that answer, and came up with something very similar,
> which I checked in. Here it is:

Thanks, Joel and Pierre!
  

Patch

From 8b558f797a3a63aaa8de119ddf53c8afdd1dc6eb Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Mon, 20 Jul 2015 15:09:44 -0700
Subject: [PATCH] gdb.ada/info_exc.exp: Adjust expected output in "info
 exception" test.

Since multi_line was moved to gdb.exp in a slightly stricter form,
The gdb.ada/info_exc.exp:info exceptions test has been failing.
This is because it now expects a new-line sequence at the end of
each argument given to multi_line, including ".*". But the intent
when writing the test was to signify "could-be-nothing-at-all".
As a result, the test fails on x86_64-linux with a runtime built as
recommended, because of that
extra new-line sequence.

gdb/testsuite/ChangeLog:

        * gdb.ada/info_exc.exp: Adjust "info exceptions" expected output.
---
 gdb/testsuite/ChangeLog            | 4 ++++
 gdb/testsuite/gdb.ada/info_exc.exp | 4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 520f606..17af4fc 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@ 
+2015-07-20  Joel Brobecker  <brobecker@adacore.com>
+
+	* gdb.ada/info_exc.exp: Adjust "info exceptions" expected output.
+
 2015-07-16  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* gdb.arch/i386-biarch-core.exp: Replace istarget
diff --git a/gdb/testsuite/gdb.ada/info_exc.exp b/gdb/testsuite/gdb.ada/info_exc.exp
index add83c5..d6ea5da 100644
--- a/gdb/testsuite/gdb.ada/info_exc.exp
+++ b/gdb/testsuite/gdb.ada/info_exc.exp
@@ -34,9 +34,7 @@  gdb_test "info exceptions" \
                 "program_error: $hex" \
                 "storage_error: $hex" \
                 "tasking_error: $hex" \
-                ".*" \
-                "const.aint_global_gdb_e: $hex" \
-                ".*"]
+                ".*\[\r\n\]*const.aint_global_gdb_e: $hex\[\r\n\]*.*" ]
 
 gdb_test "info exceptions task" \
     [multi_line "All Ada exceptions matching regular expression \"task\":" \
-- 
2.1.4