Use proc_with_prefix in py-breakpoint.exp

Use proc_with_prefix to avoid having to call with_test_prefix with a
duplicate of the proc name.  The diff is mostly lines being re-indented.

gdb/testsuite/ChangeLog:

	* gdb.python/py-breakpoint.exp (test_bkpt_basic,
	test_bkpt_deletion, test_bkpt_cond_and_cmds,
	test_bkpt_invisible, test_watchpoints, test_bkpt_internal,
	test_bkpt_eval_funcs, test_bkpt_temporary, test_bkpt_address,
	test_bkpt_pending, test_bkpt_events): Use proc_with_prefix,
	remove with_test_prefix.
This commit is contained in:
Simon Marchi 2017-10-16 15:06:14 -04:00
parent a79b1bc6f6
commit fe68b9530f
2 changed files with 388 additions and 395 deletions

View File

@ -1,3 +1,12 @@
2017-10-16 Simon Marchi <simon.marchi@ericsson.com>
* gdb.python/py-breakpoint.exp (test_bkpt_basic,
test_bkpt_deletion, test_bkpt_cond_and_cmds,
test_bkpt_invisible, test_watchpoints, test_bkpt_internal,
test_bkpt_eval_funcs, test_bkpt_temporary, test_bkpt_address,
test_bkpt_pending, test_bkpt_events): Use proc_with_prefix,
remove with_test_prefix.
2017-10-13 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (target_can_use_run_cmd): New procedure.

View File

@ -27,10 +27,9 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
# Skip all tests if Python scripting is not enabled.
if { [skip_python_tests] } { continue }
proc test_bkpt_basic { } {
proc_with_prefix test_bkpt_basic { } {
global srcfile testfile hex decimal
with_test_prefix "test_bkpt_basic" {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -113,12 +112,10 @@ proc test_bkpt_basic { } {
gdb_test "python print (blist\[2\].number)" \
"3" "Check breakpoint number 2"
}
}
proc test_bkpt_deletion { } {
proc_with_prefix test_bkpt_deletion { } {
global srcfile testfile hex decimal
with_test_prefix test_bkpt_deletion {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -151,12 +148,10 @@ proc test_bkpt_deletion { } {
gdb_continue_to_breakpoint "Break at end." \
".*$srcfile:$end_location.*"
}
}
proc test_bkpt_cond_and_cmds { } {
proc_with_prefix test_bkpt_cond_and_cmds { } {
global srcfile testfile hex decimal
with_test_prefix test_bkpt_cond_and_cmds {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -203,12 +198,10 @@ proc test_bkpt_cond_and_cmds { } {
gdb_test "python print (blist\[len(blist)-1\].commands)" \
"print \"Command for breakpoint has been executed.\".*print result"
}
}
proc test_bkpt_invisible { } {
proc_with_prefix test_bkpt_invisible { } {
global srcfile testfile hex decimal
with_test_prefix test_bkpt_invisible {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -248,12 +241,10 @@ proc test_bkpt_invisible { } {
"py-breakpoint\.c:$ibp_location.*" \
"Check maint info breakpoints shows invisible breakpoints"
}
}
proc test_watchpoints { } {
proc_with_prefix test_watchpoints { } {
global srcfile testfile hex decimal
with_test_prefix test_watchpoints {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -274,12 +265,10 @@ proc test_watchpoints { } {
".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*main.*" \
"Test watchpoint write"
}
}
proc test_bkpt_internal { } {
proc_with_prefix test_bkpt_internal { } {
global srcfile testfile hex decimal
with_test_prefix test_bkpt_internal {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -304,12 +293,10 @@ proc test_bkpt_internal { } {
".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*" \
"Test watchpoint write"
}
}
proc test_bkpt_eval_funcs { } {
proc_with_prefix test_bkpt_eval_funcs { } {
global srcfile testfile hex decimal
with_test_prefix test_bkpt_eval_funcs {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -424,12 +411,10 @@ proc test_bkpt_eval_funcs { } {
gdb_test "python print (never_eval_bp1.count)" "0" \
"Check that this unrelated breakpoints eval function was never called."
}
}
proc test_bkpt_temporary { } {
proc_with_prefix test_bkpt_temporary { } {
global srcfile testfile hex decimal
with_test_prefix test_bkpt_temporary {
# Start with a fresh gdb.
clean_restart ${testfile}
@ -466,11 +451,10 @@ proc test_bkpt_temporary { } {
gdb_test "info breakpoints" "No breakpoints or watchpoints.*" \
"Check info breakpoints shows temporary breakpoint is deleted"
}
}
# Test address locations.
proc test_bkpt_address {} {
proc_with_prefix test_bkpt_address {} {
global gdb_prompt decimal srcfile
# Delete all breakpoints
@ -500,7 +484,7 @@ proc test_bkpt_address {} {
".*Breakpoint ($decimal)+ at .*$srcfile, line ($decimal)+\."
}
proc test_bkpt_pending {} {
proc_with_prefix test_bkpt_pending {} {
delete_breakpoints
gdb_breakpoint "nosuchfunction" allow-pending
gdb_test "python print (gdb.breakpoints()\[0\].pending)" "True" \
@ -522,7 +506,7 @@ proc check_last_event {expected} {
"check for $expected event"
}
proc test_bkpt_events {} {
proc_with_prefix test_bkpt_events {} {
global testfile
clean_restart ${testfile}