public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb/testsuite: fix gdb.guile/scm-parameter.exp "wrong type argument" test pattern
@ 2022-10-24 16:43 Simon Marchi
  2022-10-24 23:22 ` Maciej W. Rozycki
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2022-10-24 16:43 UTC (permalink / raw)
  To: gdb-patches; +Cc: Maciej W . Rozycki, Simon Marchi

Since commit 90319cefe3 ("GDB/Guile: Don't assert that an integer value
is boolean"), I see:

    FAIL: gdb.guile/scm-parameter.exp: kind=PARAM_ZINTEGER: test-PARAM_ZINTEGER-param: guile (set-parameter-value! test-PARAM_ZINTEGER-param #:unlimited)
    FAIL: gdb.guile/scm-parameter.exp: kind=PARAM_ZUINTEGER: test-PARAM_ZUINTEGER-param: guile (set-parameter-value! test-PARAM_ZUINTEGER-param #:unlimited)

This comes from the fact that GDB outputs this:

    ERROR: In procedure set-parameter-value!:
    In procedure gdbscm_set_parameter_value_x: Wrong type argument in position 2 (expecting integer): #:unlimited
    Error while executing Scheme code.

while the test expects an additional "ERROR:" on the second line,
something like this:

    ERROR: In procedure set-parameter-value!:
    ERROR: In procedure gdbscm_set_parameter_value_x: Wrong type argument in position 2 (expecting integer): #:unlimited
    Error while executing Scheme code.

The patch below fixes the test for me.

I believe that the first two lines are output by Guile itself, in the
SCM_ASSERT_TYPE macro.  I tried on different systems, different Guile
versions (2.0, 2.2 and 3.0) and I always get the former output, never
the output the test expects.  I presume the patch below isn't right, as
there is surely some systems that do print the latter output, otherwise
Maciej (the original author) would have noticed it.  I presume we'll
need to accept both outputs.  But I'd like we if could clarify when we
get which.

Change-Id: I9dc45e7492a4f08340cad974610242ed689de959
---
 gdb/testsuite/gdb.guile/scm-parameter.exp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp
index b9f2d825211..5d72da935bc 100644
--- a/gdb/testsuite/gdb.guile/scm-parameter.exp
+++ b/gdb/testsuite/gdb.guile/scm-parameter.exp
@@ -183,10 +183,10 @@ foreach_with_prefix kind {
 	"end"
 
     set param_integer_error \
-	"ERROR: In procedure set-parameter-value!:\r\nERROR: In procedure\
-	 gdbscm_set_parameter_value_x: Wrong type argument in position 2\
-	 \\(expecting integer\\): #:unlimited\r\nError while executing Scheme\
-	 code\\."
+	[multi_line \
+	    "ERROR: In procedure set-parameter-value!:" \
+	    "In procedure gdbscm_set_parameter_value_x: Wrong type argument in position 2 \\(expecting integer\\): #:unlimited" \
+	    "Error while executing Scheme code\\."]
     set param_minus_one_error "integer -1 out of range"
     set param_minus_two_range "integer -2 out of range"
     set param_minus_two_unlimited "only -1 is allowed to set as unlimited"
-- 
2.37.3


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

end of thread, other threads:[~2022-10-31 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 16:43 [PATCH] gdb/testsuite: fix gdb.guile/scm-parameter.exp "wrong type argument" test pattern Simon Marchi
2022-10-24 23:22 ` Maciej W. Rozycki
2022-10-25  1:08   ` Simon Marchi
2022-10-26  7:15     ` Tom de Vries
2022-10-26 15:31       ` Simon Marchi
2022-10-29 13:56         ` [OB PATCH] gdb/testsuite: Wrap `param_integer_error' in gdb.guile/scm-parameter.exp Maciej W. Rozycki
2022-10-31 12:57           ` Simon Marchi

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).