This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA 2/2] Make some test names invariant


While working on the previous patch, I noticed that the test names in
process-dies-while-detaching include the PID of some test process,
making it so that the test names change between runs.  This patch
fixes the problem.

2016-09-14  Tom Tromey  <tom@tromey.com>

	* gdb.threads/process-dies-while-detaching.exp
	(test_detach_killed_outside): Pass test name to
	get_integer_valueof.
	* lib/gdb.exp (get_integer_valueof): Add "test" argument.
---
 gdb/testsuite/ChangeLog                                    | 7 +++++++
 gdb/testsuite/gdb.threads/process-dies-while-detaching.exp | 2 +-
 gdb/testsuite/lib/gdb.exp                                  | 6 ++++--
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e34ae67..b397364 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2016-09-14  Tom Tromey  <tom@tromey.com>
+
+	* gdb.threads/process-dies-while-detaching.exp
+	(test_detach_killed_outside): Pass test name to
+	get_integer_valueof.
+	* lib/gdb.exp (get_integer_valueof): Add "test" argument.
+
 2016-09-13  Tom Tromey  <tom@tromey.com>
 
 	PR gdb/20604:
diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
index 52dc8dd..734effc 100644
--- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
+++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
@@ -268,7 +268,7 @@ proc test_detach_killed_outside {multi_process cmd} {
 	# Run to _exit in the child.
 	continue_to_exit_bp
 
-	set childpid [get_integer_valueof "mypid" -1]
+	set childpid [get_integer_valueof "mypid" -1 "get value of mypid"]
 	if { $childpid == -1 } {
 	    untested "failed to extract child pid"
 	    return -1
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index e538812..9abe3cd 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5524,10 +5524,12 @@ proc get_valueof { fmt exp default } {
     return ${val}
 }
 
-proc get_integer_valueof { exp default } {
+proc get_integer_valueof { exp default {test ""} } {
     global gdb_prompt
 
-    set test "get integer valueof \"${exp}\""
+    if {$test == ""} {
+	set test "get integer valueof \"${exp}\""
+    }
     set val ${default}
     gdb_test_multiple "print /d ${exp}" "$test" {
 	-re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {
-- 
2.7.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]