public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Use with_test_prefix in gdb.base/gdb-caching-proc.exp
@ 2020-05-18 14:34 Tom de Vries
  2020-05-18 17:30 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Tom de Vries @ 2020-05-18 14:34 UTC (permalink / raw)
  To: gdb-patches

Hi,

When running test-case gdb.base/gdb-caching-proc.exp all passes are unique,
but fails might not be.

Fix this by using with_test_prefix.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Use with_test_prefix in gdb.base/gdb-caching-proc.exp

gdb/testsuite/ChangeLog:

2020-05-18  Tom de Vries  <tdevries@suse.de>

	* gdb.base/gdb-caching-proc.exp: Use with_test_prefix.

---
 gdb/testsuite/gdb.base/gdb-caching-proc.exp | 42 ++++++++++++++++-------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/gdb/testsuite/gdb.base/gdb-caching-proc.exp b/gdb/testsuite/gdb.base/gdb-caching-proc.exp
index 3810347a65..f1dd834cf9 100644
--- a/gdb/testsuite/gdb.base/gdb-caching-proc.exp
+++ b/gdb/testsuite/gdb.base/gdb-caching-proc.exp
@@ -28,7 +28,9 @@ proc test_proc { name } {
 
     set resultlist [list]
 
-    set first [gdb_do_cache_wrap $real_name]
+    with_test_prefix intial {
+	set first [gdb_do_cache_wrap $real_name]
+    }
     lappend resultlist $first
 
     # Ten repetitions was enough to trigger target_supports_scheduler_locking,
@@ -37,7 +39,9 @@ proc test_proc { name } {
 
     set racy 0
     for {set i 0} {$i < $repeat} {incr i} {
-	set rerun [gdb_do_cache_wrap $real_name]
+	with_test_prefix $i {
+	    set rerun [gdb_do_cache_wrap $real_name]
+	}
 	lappend resultlist $rerun
 	if { $rerun != $first } {
 	    set racy 1
@@ -45,9 +49,9 @@ proc test_proc { name } {
     }
 
     if { $racy  == 0 } {
-	pass "$name consistency"
+	pass "consistency"
     } else {
-	fail "$name consistency"
+	fail "consistency"
 	verbose -log "$name: $resultlist"
     }
 }
@@ -77,20 +81,22 @@ proc test_file { file } {
     }
 
     foreach procname $procnames {
-	switch $procname {
-	    "is_address_zero_readable" { set setup_gdb 1 }
-	    "target_is_gdbserver" { set setup_gdb 1 }
-	    default {set setup_gdb 0 }
-	}
-
-	if { $setup_gdb } {
-	    clean_restart $obj
-	}
-
-	test_proc $procname
-
-	if { $setup_gdb } {
-	    gdb_exit
+	with_test_prefix $procname {
+	    switch $procname {
+		"is_address_zero_readable" { set setup_gdb 1 }
+		"target_is_gdbserver" { set setup_gdb 1 }
+		default {set setup_gdb 0 }
+	    }
+
+	    if { $setup_gdb } {
+		clean_restart $obj
+	    }
+
+	    test_proc $procname
+
+	    if { $setup_gdb } {
+		gdb_exit
+	    }
 	}
     }
 }

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

* Re: [committed][gdb/testsuite] Use with_test_prefix in gdb.base/gdb-caching-proc.exp
  2020-05-18 14:34 [committed][gdb/testsuite] Use with_test_prefix in gdb.base/gdb-caching-proc.exp Tom de Vries
@ 2020-05-18 17:30 ` Tom Tromey
  2020-05-19 18:49   ` Tom de Vries
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2020-05-18 17:30 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> +    with_test_prefix intial {

Probably meant "initial" here.

Tom

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

* Re: [committed][gdb/testsuite] Use with_test_prefix in gdb.base/gdb-caching-proc.exp
  2020-05-18 17:30 ` Tom Tromey
@ 2020-05-19 18:49   ` Tom de Vries
  0 siblings, 0 replies; 3+ messages in thread
From: Tom de Vries @ 2020-05-19 18:49 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

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

On 18-05-2020 19:30, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> +    with_test_prefix intial {
> 
> Probably meant "initial" here.

Ack, thanks for noticing.

Fixed in committed patch below.

- Tom

[-- Attachment #2: 0001-gdb-testsuite-Fix-typo-in-gdb.base-gdb-caching-proc.exp.patch --]
[-- Type: text/x-patch, Size: 767 bytes --]

[gdb/testsuite] Fix typo in gdb.base/gdb-caching-proc.exp

Fix intial -> initial typo.

gdb/testsuite/ChangeLog:

2020-05-19  Tom de Vries  <tdevries@suse.de>

	* gdb.base/gdb-caching-proc.exp: Fix typo.

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

diff --git a/gdb/testsuite/gdb.base/gdb-caching-proc.exp b/gdb/testsuite/gdb.base/gdb-caching-proc.exp
index f1dd834cf9..831f8d0acc 100644
--- a/gdb/testsuite/gdb.base/gdb-caching-proc.exp
+++ b/gdb/testsuite/gdb.base/gdb-caching-proc.exp
@@ -28,7 +28,7 @@ proc test_proc { name } {
 
     set resultlist [list]
 
-    with_test_prefix intial {
+    with_test_prefix initial {
 	set first [gdb_do_cache_wrap $real_name]
     }
     lappend resultlist $first

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

end of thread, other threads:[~2020-05-19 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 14:34 [committed][gdb/testsuite] Use with_test_prefix in gdb.base/gdb-caching-proc.exp Tom de Vries
2020-05-18 17:30 ` Tom Tromey
2020-05-19 18:49   ` Tom de Vries

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