From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Use with_test_prefix in gdb.base/gdb-caching-proc.exp
Date: Mon, 18 May 2020 16:34:35 +0200 [thread overview]
Message-ID: <20200518143433.GA17687@delia> (raw)
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
+ }
}
}
}
next reply other threads:[~2020-05-18 14:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 14:34 Tom de Vries [this message]
2020-05-18 17:30 ` Tom Tromey
2020-05-19 18:49 ` Tom de Vries
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=20200518143433.GA17687@delia \
--to=tdevries@suse.de \
--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