aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-08-05 15:41:04 +0200
committerTom de Vries <tdevries@suse.de>2019-08-05 15:41:04 +0200
commitd86bd7cba1965c621b63792179febcf9eeb273ad (patch)
tree9f7184ec615830080c6ea3216ad3bb13cbac1849 /gdb/testsuite/gdb.base
parent8abfcabcb49fcd8b95854a5b59e7928e3c6000ff (diff)
downloadgdb-d86bd7cba1965c621b63792179febcf9eeb273ad.zip
gdb-d86bd7cba1965c621b63792179febcf9eeb273ad.tar.gz
gdb-d86bd7cba1965c621b63792179febcf9eeb273ad.tar.bz2
[gdb/testsuite] Run read1 timeout tests with with_read1_timeout_factor
When running tests with check-read1, we run into some timeouts where the tests are not easy to rewrite using gdb_test_sequence: ... FAIL: gdb.base/help.exp: help data (timeout) FAIL: gdb.base/help.exp: help files (timeout) FAIL: gdb.base/help.exp: help internals (timeout) FAIL: gdb.base/help.exp: help user-defined (timeout) FAIL: gdb.base/help.exp: help breakpoint "b" abbreviation (timeout) FAIL: gdb.base/help.exp: help breakpoint "br" abbreviation (timeout) FAIL: gdb.base/help.exp: help breakpoint "bre" abbreviation (timeout) FAIL: gdb.base/info-macros.exp: info macros 2 (timeout) FAIL: gdb.base/info-macros.exp: next (timeout) FAIL: gdb.base/info-macros.exp: info macros 3 (timeout) FAIL: gdb.base/info-macros.exp: next (timeout) FAIL: gdb.base/info-macros.exp: next (timeout) FAIL: gdb.base/info-macros.exp: info macros (timeout) FAIL: gdb.base/info-macros.exp: next (timeout) FAIL: gdb.base/info-macros.exp: next (timeout) FAIL: gdb.base/info-macros.exp: info macros 7 (timeout) FAIL: gdb.cp/nested-types.exp: ptype S10 (limit = -1) // parse failed (timeout) FAIL: gdb.cp/nested-types.exp: set print type nested-type-limit 1 (timeout) ... Fix these by increasing the timeout by a factor 10. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-08-05 Tom de Vries <tdevries@suse.de> PR testsuite/24863 * lib/gdb.exp (with_read1_timeout_factor): New proc. * gdb.base/help.exp: Use with_read1_timeout_factor. * gdb.base/info-macros.exp: Same. * gdb.cp/nested-types.exp: Same.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/help.exp54
-rw-r--r--gdb/testsuite/gdb.base/info-macros.exp21
2 files changed, 44 insertions, 31 deletions
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
index e65f7c8..19933db 100644
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -29,13 +29,15 @@ test_class_help "aliases" {"Aliases of other commands\.\[\r\n\]+"}
test_class_help "breakpoints" {
"Making program stop at certain points\.\[\r\n\]+"
}
-test_class_help "data" {"Examining data\.\[\r\n\]+"}
-test_class_help "files" {"Specifying and examining files\.\[\r\n\]+"}
-test_class_help "internals" {
- "Maintenance commands\.\[\r\n\]+"
- "Some gdb commands are provided just for use by gdb maintainers\.\[\r\n\]+"
- "These commands are subject to frequent change, and may not be as\[\r\n\]+"
- "well documented as user commands\.\[\r\n\]+"
+with_read1_timeout_factor 10 {
+ test_class_help "data" {"Examining data\.\[\r\n\]+"}
+ test_class_help "files" {"Specifying and examining files\.\[\r\n\]+"}
+ test_class_help "internals" {
+ "Maintenance commands\.\[\r\n\]+"
+ "Some gdb commands are provided just for use by gdb maintainers\.\[\r\n\]+"
+ "These commands are subject to frequent change, and may not be as\[\r\n\]+"
+ "well documented as user commands\.\[\r\n\]+"
+ }
}
test_class_help "obscure" {"Obscure features\.\[\r\n\]+"}
test_class_help "running" {"Running the program\.\[\r\n\]+"}
@@ -44,25 +46,29 @@ test_class_help "stack" {
"When the program being debugged stops, gdb selects the innermost frame\.\[\r\n\]+"
"The commands below can be used to select other frames by number or address\.\[\r\n\]+"
}
-test_class_help "status" {
- "Status inquiries\.\[\r\n\]+"
-}
-test_class_help "support" {"Support facilities\.\[\r\n\]+"}
-test_class_help "tracepoints" {
- "Tracing of program execution without stopping the program\.\[\r\n\]+"
+with_read1_timeout_factor 10 {
+ test_class_help "status" {
+ "Status inquiries\.\[\r\n\]+"
+ }
+ test_class_help "support" {"Support facilities\.\[\r\n\]+"}
+ test_class_help "tracepoints" {
+ "Tracing of program execution without stopping the program\.\[\r\n\]+"
+ }
}
-test_user_defined_class_help
-
-# Test help of an abbreviated command. "break" is picked at random.
-set help_breakpoint_text "Set breakpoint at specified location\..*"
-# test help breakpoint "b" abbreviation
-gdb_test "help b" $help_breakpoint_text "help breakpoint \"b\" abbreviation"
-# test help breakpoint "br" abbreviation
-gdb_test "help br" $help_breakpoint_text "help breakpoint \"br\" abbreviation"
-# test help breakpoint "bre" abbreviation
-gdb_test "help bre" $help_breakpoint_text "help breakpoint \"bre\" abbreviation"
-# test help breakpoint "brea" abbreviation
+with_read1_timeout_factor 10 {
+ test_user_defined_class_help
+
+ # Test help of an abbreviated command. "break" is picked at random.
+ set help_breakpoint_text "Set breakpoint at specified location\..*"
+ # test help breakpoint "b" abbreviation
+ gdb_test "help b" $help_breakpoint_text "help breakpoint \"b\" abbreviation"
+ # test help breakpoint "br" abbreviation
+ gdb_test "help br" $help_breakpoint_text "help breakpoint \"br\" abbreviation"
+ # test help breakpoint "bre" abbreviation
+ gdb_test "help bre" $help_breakpoint_text "help breakpoint \"bre\" abbreviation"
+ # test help breakpoint "brea" abbreviation
+}
gdb_test "help brea" $help_breakpoint_text "help breakpoint \"brea\" abbreviation"
# test help breakpoint "break" abbreviation
gdb_test "help break" $help_breakpoint_text "help breakpoint \"break\" abbreviation"
diff --git a/gdb/testsuite/gdb.base/info-macros.exp b/gdb/testsuite/gdb.base/info-macros.exp
index b76a5bb..e2385fa 100644
--- a/gdb/testsuite/gdb.base/info-macros.exp
+++ b/gdb/testsuite/gdb.base/info-macros.exp
@@ -132,12 +132,19 @@ set test "info macro -a -- FOO"
set testname "$test"
gdb_test "$test" "$r1$r2$r3$r4" "$testname"
+proc gdb_test_multiple_with_read1_timeout_factor { factor command message \
+ user_code } {
+ with_read1_timeout_factor $factor {
+ uplevel [list gdb_test_multiple $command $message $user_code]
+ }
+}
+
set test "info macros"
set r1 ".*#define FOO \"hello\""
set r2 ".*#define ONE"
set r3 ".*\r\n$gdb_prompt"
set testname "$test 2"
-gdb_test_multiple "$test" $testname {
+gdb_test_multiple_with_read1_timeout_factor 10 "$test" $testname {
-re "$r1$r2$r3" {
pass $testname
}
@@ -158,7 +165,7 @@ set r2 ".*#define ONE"
set r3 ".*#define TWO"
set r4 ".*\r\n$gdb_prompt"
set testname "$test 3"
-gdb_test_multiple "$test" $testname {
+gdb_test_multiple_with_read1_timeout_factor 10 "$test" $testname {
-re ".*#define THREE.*\r\n$gdb_prompt" {
fail $testname
}
@@ -178,7 +185,7 @@ set r3 ".*#define THREE"
set r4 ".*#define TWO"
set r5 ".*\r\n$gdb_prompt"
set testname "$test 4"
-gdb_test_multiple "$test" $testname {
+gdb_test_multiple_with_read1_timeout_factor 10 "$test" $testname {
-re ".*#define FOUR.*\r\n$gdb_prompt" {
fail $testname
}
@@ -188,7 +195,7 @@ gdb_test_multiple "$test" $testname {
}
# same as above with a linespec.
set test "info macros *\$pc"
-gdb_test_multiple "$test" $test {
+gdb_test_multiple_with_read1_timeout_factor 10 "$test" $test {
-re ".*#define FOUR.*\r\n$gdb_prompt" {
fail $test
}
@@ -204,7 +211,7 @@ set r3 ".*#define TWO."
set r4 ".*\r\n$gdb_prompt"
set test "info macros"
set testname "$test 5"
-gdb_test_multiple "$test" $test {
+gdb_test_multiple_with_read1_timeout_factor 10 "$test" $test {
-re ".*#define THREE.*\r\n$gdb_prompt" {
fail $testname
}
@@ -221,7 +228,7 @@ gdb_test "next" ".*" ""
set r1 ".*#define DEF_MACROS"
set r2 ".*\r\n$gdb_prompt"
set testname "$test 6"
-gdb_test_multiple "$test" $testname {
+gdb_test_multiple_with_read1_timeout_factor 10 "$test" $testname {
-re ".*#define FOO \" \".*\r\n$gdb_prompt" {
fail $testname
}
@@ -257,7 +264,7 @@ set r2 ".*#define FOO\\(a\\) foo = a"
set r3 ".*#define FOUR"
set r4 ".*\r\n$gdb_prompt"
set testname "$test 7"
-gdb_test_multiple "$test" $testname {
+gdb_test_multiple_with_read1_timeout_factor 10 "$test" $testname {
-re ".*#define FOO \" \".*\r\n$gdb_prompt" {
fail $testname
}