diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d7eef34a3df..37fe6a10198 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2014-09-09 Maciej W. Rozycki + + * gdb.base/watchpoint-solib.exp: Increase the timeout by a factor + of 30 rather than hardcoding 120 for a slow test case. Take the + `gdb,timeout' target setting into account for this calculation. + Don't extend the timeout for the test cases that don't need it. + 2014-09-09 Maciej W. Rozycki * gdb.reverse/sigall-reverse.exp: Increase the timeout by diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.exp b/gdb/testsuite/gdb.base/watchpoint-solib.exp index 1056549e387..5a7947412db 100644 --- a/gdb/testsuite/gdb.base/watchpoint-solib.exp +++ b/gdb/testsuite/gdb.base/watchpoint-solib.exp @@ -70,14 +70,22 @@ gdb_test_multiple "break foo" "set pending breakpoint" { } } -set prev_timeout $timeout -set timeout 120 - gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo" gdb_test "watch g" "atchpoint 3: g" "set watchpoint on g" gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit" rerun_to_main -gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again" -gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again" -set timeout $prev_timeout +set savedtimeout $timeout +if { [target_info exists gdb,timeout] + && $timeout < [target_info gdb,timeout] } { + set oldtimeout [target_info gdb,timeout] +} else { + set oldtimeout $timeout +} +set timeout [expr $oldtimeout * 30] + +gdb_test "continue" ".*Breakpoint 2.*foo.*" "continue to foo again" + +set timeout $savedtimeout + +gdb_test "continue" ".*New value = 1.*" "continue to watchpoint hit again"