aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-10-25 10:48:12 +0200
committerTom de Vries <tdevries@suse.de>2019-10-25 10:48:12 +0200
commit158da0d12a7c9bb01c6d9b8d3da609a1e2561916 (patch)
tree6eab0a30f900d8e90d7e866b328c6ae2d0308993
parent30fe183248b2523ecff9da36853e2f893c4c4b91 (diff)
downloadgdb-158da0d12a7c9bb01c6d9b8d3da609a1e2561916.zip
gdb-158da0d12a7c9bb01c6d9b8d3da609a1e2561916.tar.gz
gdb-158da0d12a7c9bb01c6d9b8d3da609a1e2561916.tar.bz2
[gdb/testsuite] Use -wrap and $gdb_test_name in gdb_test_multiple calls (2)
Make gdb_test_multiple calls shorter by using new gdb_test_multiple variable $gdb_test_name and new gdb_test_multiple pattern flag -wrap. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-10-25 Tom de Vries <tdevries@suse.de> * gdb.reverse/sigall-precsave.exp: Use -wrap and $gdb_test_name in gdb_test_multiple calls. * gdb.reverse/sigall-reverse.exp: Same. * gdb.reverse/solib-precsave.exp: Same. * gdb.reverse/solib-reverse.exp: Same. * gdb.reverse/until-precsave.exp: Same. * gdb.reverse/until-reverse.exp: Same. Change-Id: I67bb327d069dbc439410996bcfe6c7f905b2ca52
-rw-r--r--gdb/testsuite/ChangeLog10
-rw-r--r--gdb/testsuite/gdb.reverse/sigall-precsave.exp14
-rw-r--r--gdb/testsuite/gdb.reverse/sigall-reverse.exp22
-rw-r--r--gdb/testsuite/gdb.reverse/solib-precsave.exp13
-rw-r--r--gdb/testsuite/gdb.reverse/solib-reverse.exp13
-rw-r--r--gdb/testsuite/gdb.reverse/until-precsave.exp13
-rw-r--r--gdb/testsuite/gdb.reverse/until-reverse.exp13
7 files changed, 47 insertions, 51 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index faee8e0..b4228ce 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2019-10-25 Tom de Vries <tdevries@suse.de>
+
+ * gdb.reverse/sigall-precsave.exp: Use -wrap and $gdb_test_name in
+ gdb_test_multiple calls.
+ * gdb.reverse/sigall-reverse.exp: Same.
+ * gdb.reverse/solib-precsave.exp: Same.
+ * gdb.reverse/solib-reverse.exp: Same.
+ * gdb.reverse/until-precsave.exp: Same.
+ * gdb.reverse/until-reverse.exp: Same.
+
2019-10-24 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (gdb_test_multiple): Add -wrap pattern flag.
diff --git a/gdb/testsuite/gdb.reverse/sigall-precsave.exp b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
index 94ae263..8584190 100644
--- a/gdb/testsuite/gdb.reverse/sigall-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-precsave.exp
@@ -258,18 +258,16 @@ foreach sig $signals {
}
}
-set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
-set test "run to end of main"
-gdb_test_multiple "continue" $test {
- -re "Breakpoint .* end of main .*$gdb_prompt $" {
- pass $test
+gdb_test_multiple "continue" "run to end of main" {
+ -wrap -re "Breakpoint .* end of main .*" {
+ pass $gdb_test_name
}
- -re "Breakpoint .* handle_.*$gdb_prompt $" {
+ -wrap -re "Breakpoint .* handle_.*" {
send_gdb "continue\n"
exp_continue
}
- -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "gdb/25038" $test
+ -wrap -re "Process record does not support instruction 0xfae64 at.*" {
+ kfail "gdb/25038" $gdb_test_name
return -1
}
}
diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.exp b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
index ecebf05..a4ed639 100644
--- a/gdb/testsuite/gdb.reverse/sigall-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/sigall-reverse.exp
@@ -51,21 +51,21 @@ proc test_one_sig {nextsig} {
if { $thissig == "IO" } {
setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
}
- set testmsg "get signal $thissig"
- set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
- gdb_test_multiple "continue" $testmsg {
- -re "Program received signal SIG$thissig.*handle_$thissig.*$gdb_prompt $" {
- fail "$testmsg (wrong location)"
+ gdb_test_multiple "continue" "get signal $thissig" {
+ -wrap -re \
+ "Program received signal SIG$thissig.*handle_$thissig.*" {
+ fail "$gdb_test_name (wrong location)"
}
- -re "Program received signal SIG$thissig.*$gdb_prompt $" {
- pass $testmsg
+ -wrap -re "Program received signal SIG$thissig.*" {
+ pass $gdb_test_name
}
- -re "Breakpoint.* handle_$thissig.*$gdb_prompt $" {
- xfail $testmsg
+ -wrap -re "Breakpoint.* handle_$thissig.*" {
+ xfail $gdb_test_name
set need_another_continue 0
}
- -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "gdb/25038" "$testmsg"
+ -wrap -re \
+ "Process record does not support instruction 0xfae64 at.*" {
+ kfail "gdb/25038" $gdb_test_name
set record_instruction_kfail 1
return
}
diff --git a/gdb/testsuite/gdb.reverse/solib-precsave.exp b/gdb/testsuite/gdb.reverse/solib-precsave.exp
index a3f874c..165580d 100644
--- a/gdb/testsuite/gdb.reverse/solib-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/solib-precsave.exp
@@ -91,15 +91,12 @@ gdb_test "break $end_of_main" \
"Breakpoint $decimal at .*$srcfile, line $end_of_main\." \
"breakpoint at end of main"
-set test "run to end of main"
-set pass_pattern "Breakpoint .* end of main .*"
-set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
-gdb_test_multiple "continue" $test {
- -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" {
- pass $test
+gdb_test_multiple "continue" "run to end of main" {
+ -wrap -re "Breakpoint .* end of main .*" {
+ pass $gdb_test_name
}
- -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "gdb/25038" $test
+ -wrap -re "Process record does not support instruction 0xfae64 at.*" {
+ kfail "gdb/25038" $gdb_test_name
return -1
}
}
diff --git a/gdb/testsuite/gdb.reverse/solib-reverse.exp b/gdb/testsuite/gdb.reverse/solib-reverse.exp
index 53b3523..6d4a8a1 100644
--- a/gdb/testsuite/gdb.reverse/solib-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/solib-reverse.exp
@@ -86,15 +86,12 @@ if [supports_process_record] {
set end_part_one [gdb_get_line_number " end part one" "$srcfile"]
set end_part_two [gdb_get_line_number " end part two" "$srcfile"]
-set test "run until end part one"
-set pass_pattern " end part one.*"
-set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
-gdb_test_multiple "until $end_part_one" $test {
- -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" {
- pass $test
+gdb_test_multiple "until $end_part_one" "run until end part one" {
+ -wrap -re " end part one.*" {
+ pass $gdb_test_name
}
- -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "gdb/25038" $test
+ -wrap -re "Process record does not support instruction 0xfae64 at.*" {
+ kfail "gdb/25038" $gdb_test_name
return -1
}
}
diff --git a/gdb/testsuite/gdb.reverse/until-precsave.exp b/gdb/testsuite/gdb.reverse/until-precsave.exp
index 1f09df1..ad59a52 100644
--- a/gdb/testsuite/gdb.reverse/until-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/until-precsave.exp
@@ -50,15 +50,12 @@ gdb_test "break $end_of_main" \
# This can take awhile.
with_timeout_factor 20 {
- set test "run to end of main"
- set pass_pattern "Breakpoint .* set breakpoint 10a here .*"
- set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
- gdb_test_multiple "continue" $test {
- -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" {
- pass $test
+ gdb_test_multiple "continue" "run to end of main" {
+ -wrap -re "Breakpoint .* set breakpoint 10a here .*" {
+ pass $gdb_test_name
}
- -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "gdb/25038" $test
+ -wrap -re "Process record does not support instruction 0xfae64 at.*" {
+ kfail "gdb/25038" $gdb_test_name
return -1
}
}
diff --git a/gdb/testsuite/gdb.reverse/until-reverse.exp b/gdb/testsuite/gdb.reverse/until-reverse.exp
index 804e07f..b7ce548 100644
--- a/gdb/testsuite/gdb.reverse/until-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/until-reverse.exp
@@ -49,15 +49,12 @@ gdb_test "until $bp_location1" \
# Advance up to factorial, outer invocation
#
-set test "advance to factorial"
-set pass_pattern "factorial .value=6..*$srcfile:$bp_location7.*"
-set kfail_pattern "Process record does not support instruction 0xfae64 at.*"
-gdb_test_multiple "advance factorial" $test {
- -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" {
- pass "$test"
+gdb_test_multiple "advance factorial" "" {
+ -wrap -re "factorial .value=6..*$srcfile:$bp_location7.*" {
+ pass $gdb_test_name
}
- -re "\[\r\n\]*(?:$kfail_pattern)\[\r\n\]+$gdb_prompt $" {
- kfail "gdb/25038" $test
+ -wrap -re "Process record does not support instruction 0xfae64 at.*" {
+ kfail "gdb/25038" $gdb_test_name
return -1
}
}