[gdb/testsuite] Make gdb_test message unique in multi-term-settings.exp

Message ID 20190822142148.GA5361@delia
State New, archived
Headers

Commit Message

Tom de Vries Aug. 22, 2019, 2:21 p.m. UTC
  Hi,

This racy fail message, reported in PR24929:
...
FAIL: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: \
  stop with control-c
...
does not make clear which gdb_test fails here:
...
    if {$expect_ttou} {
       gdb_test "" "Quit" "stop with control-c"
    } else {
       gdb_test "" "received signal SIGINT.*" "stop with control-c"
    }
...

Fix this by making the gdb_test message argument unique.

Tested on x86_64-linux.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Make gdb_test message unique in multi-term-settings.exp

gdb/testsuite/ChangeLog:

2019-08-22  Tom de Vries  <tdevries@suse.de>

	* gdb.multi/multi-term-settings.exp (coretest): Make gdb_test messages
	unique.

---
 gdb/testsuite/gdb.multi/multi-term-settings.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Pedro Alves Aug. 22, 2019, 2:46 p.m. UTC | #1
On 8/22/19 3:21 PM, Tom de Vries wrote:
> Hi,
> 
> This racy fail message, reported in PR24929:
> ...
> FAIL: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: \
>   stop with control-c
> ...
> does not make clear which gdb_test fails here:
> ...
>     if {$expect_ttou} {
>        gdb_test "" "Quit" "stop with control-c"
>     } else {
>        gdb_test "" "received signal SIGINT.*" "stop with control-c"
>     }
> ...
> 
> Fix this by making the gdb_test message argument unique.

Pedantically, adding " (foo)" is not considered to make a message
unique.  

" (foo)" is just informative (and likewise used in other parts of
the testcase in that fashion).

The message is already unique given the "inf1_how=attach: inf2_how=attach:"
prefix.

> 
> Tested on x86_64-linux.
> 
> OK for trunk?

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/testsuite/gdb.multi/multi-term-settings.exp b/gdb/testsuite/gdb.multi/multi-term-settings.exp
index fd3883b692..1c550aaa2e 100644
--- a/gdb/testsuite/gdb.multi/multi-term-settings.exp
+++ b/gdb/testsuite/gdb.multi/multi-term-settings.exp
@@ -212,9 +212,9 @@  proc coretest {inf1_how inf2_how} {
 
     send_gdb "\003"
     if {$expect_ttou} {
-	gdb_test "" "Quit" "stop with control-c"
+	gdb_test "" "Quit" "stop with control-c (Quit)"
     } else {
-	gdb_test "" "received signal SIGINT.*" "stop with control-c"
+	gdb_test "" "received signal SIGINT.*" "stop with control-c (SIGINT)"
     }
 
     # Useful for debugging in case the Ctrl-C above fails.