public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PUSHED 0/2] Fix some duplicate test names.
@ 2022-06-09 12:45 Andrew Burgess
  2022-06-09 12:45 ` [PUSHED 1/2] gdb/testsuite: resolve duplicate test name in gnu_vector.exp Andrew Burgess
  2022-06-09 12:45 ` [PUSHED 2/2] gdb/testsuite: resolve duplicate test names in gdb.threads/tls.exp Andrew Burgess
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Burgess @ 2022-06-09 12:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

While testing on an AArch64 target with no Python support I spotted
some duplicate test names.  Fixed by this series.

---

Andrew Burgess (2):
  gdb/testsuite: resolve duplicate test name in gnu_vector.exp
  gdb/testsuite: resolve duplicate test names in gdb.threads/tls.exp

 gdb/testsuite/gdb.base/gnu_vector.exp | 20 +++++++++++---------
 gdb/testsuite/gdb.threads/tls.exp     |  5 ++++-
 2 files changed, 15 insertions(+), 10 deletions(-)

-- 
2.25.4


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

* [PUSHED 1/2] gdb/testsuite: resolve duplicate test name in gnu_vector.exp
  2022-06-09 12:45 [PUSHED 0/2] Fix some duplicate test names Andrew Burgess
@ 2022-06-09 12:45 ` Andrew Burgess
  2022-06-09 12:45 ` [PUSHED 2/2] gdb/testsuite: resolve duplicate test names in gdb.threads/tls.exp Andrew Burgess
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2022-06-09 12:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

While testing on AArch64 I spotted a duplicate test name in the
gdb.base/gnu_vector.exp test.

This commit adds a 'with_test_prefix' to resolve the duplicate.

While I was in the area I updated a 'gdb_test_multiple' call to make
use of $gdb_test_name.

There should be no change in what is tested after this commit.
---
 gdb/testsuite/gdb.base/gnu_vector.exp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/gdb/testsuite/gdb.base/gnu_vector.exp b/gdb/testsuite/gdb.base/gnu_vector.exp
index b47be65cc1f..796d9e947e1 100644
--- a/gdb/testsuite/gdb.base/gnu_vector.exp
+++ b/gdb/testsuite/gdb.base/gnu_vector.exp
@@ -222,16 +222,18 @@ gdb_test "print add_structvecs(i2, (struct just_int2)\{2*i2\}, (struct two_int2)
 gdb_test "print add_singlevecs((char1) \{6\}, (int1) \{12\}, (double1) \{24\})" "= \\{42\\}" \
     "call add_singlevecs"
 
-# Test "finish" from vector-valued function.
 gdb_breakpoint "add_some_intvecs"
-gdb_continue "add_some_intvecs"
-set test "finish shows vector return value"
-gdb_test_multiple "finish" $test {
-    -re "Value returned is .* = \\{10, 20, 48, 72\\}.*$gdb_prompt $" {
-	pass $test
-    }
-    -re "Value returned has type: .* Cannot determine contents.*$gdb_prompt $" {
-	kfail "gdb/8549" $test
+
+# Test "finish" from vector-valued function.
+with_test_prefix "finish from vector function" {
+    gdb_continue "add_some_intvecs"
+    gdb_test_multiple "finish" "shows vector return value" {
+	-re "Value returned is .* = \\{10, 20, 48, 72\\}.*$gdb_prompt $" {
+	    pass $gdb_test_name
+	}
+	-re "Value returned has type: .* Cannot determine contents.*$gdb_prompt $" {
+	    kfail "gdb/8549" $gdb_test_name
+	}
     }
 }
 
-- 
2.25.4


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

* [PUSHED 2/2] gdb/testsuite: resolve duplicate test names in gdb.threads/tls.exp
  2022-06-09 12:45 [PUSHED 0/2] Fix some duplicate test names Andrew Burgess
  2022-06-09 12:45 ` [PUSHED 1/2] gdb/testsuite: resolve duplicate test name in gnu_vector.exp Andrew Burgess
@ 2022-06-09 12:45 ` Andrew Burgess
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2022-06-09 12:45 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

While running the gdb.threads/tls.exp test with a GDB configured
without Python, I noticed some duplicate test names.

This is caused by a call to skip_python_tests that is within a proc
that is called multiple times by the test script.  Each call to
skip_python_tests results in a call to 'unsupported', and this causes
the duplicate test names.

After this commit we now call skip_python_tests just once and place
the result into a variable.  Now, instead of calling skip_python_tests
multiple times, we just check the variable.

There should be no change in what is tested after this commit.
---
 gdb/testsuite/gdb.threads/tls.exp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp
index 486e29dd901..4f88c0ec987 100644
--- a/gdb/testsuite/gdb.threads/tls.exp
+++ b/gdb/testsuite/gdb.threads/tls.exp
@@ -72,7 +72,7 @@ proc check_thread_local {number} {
 	    "= $expected_value" \
 	    "${number} thread local storage"
 
-    if {![skip_python_tests]} {
+    if {!$::has_python_support} {
 	gdb_test_no_output \
 	    "python sym = gdb.lookup_symbol('a_thread_local')\[0\]" \
 	    "${number} look up a_thread_local symbol"
@@ -155,6 +155,9 @@ proc check_thread_stack {number spin_threads spin_threads_level} {
 
 clean_restart ${binfile}
 
+# Set this to avoid calling skip_python_tests repeatedly.
+set has_python_support [skip_python_tests]
+
 gdb_test_multiple "print a_thread_local" "" {
     -re -wrap "Cannot find thread-local variables on this target" {
 	kfail "gdb/25807" $gdb_test_name
-- 
2.25.4


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

end of thread, other threads:[~2022-06-09 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 12:45 [PUSHED 0/2] Fix some duplicate test names Andrew Burgess
2022-06-09 12:45 ` [PUSHED 1/2] gdb/testsuite: resolve duplicate test name in gnu_vector.exp Andrew Burgess
2022-06-09 12:45 ` [PUSHED 2/2] gdb/testsuite: resolve duplicate test names in gdb.threads/tls.exp Andrew Burgess

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