From 96b6697fd807428f3832bdab1527ad55156e88d7 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Fri, 7 Sep 2018 14:06:53 +0100 Subject: [PATCH] gdb/testsuite: Make test names unique in gdb.base/watchpoint.exp Extend test names and add test name prefixes to make test names unique. gdb/testsuite/ChangeLog: * gdb.base/watchpoint.exp (test_complex_watchpoint): Extend test names, and add test prefixes to make test names unique. --- gdb/testsuite/ChangeLog | 5 +++ gdb/testsuite/gdb.base/watchpoint.exp | 52 ++++++++++++++------------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a7059332496..d808d8bb785 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-07 Andrew Burgess + + * gdb.base/watchpoint.exp (test_complex_watchpoint): Extend test + names, and add test prefixes to make test names unique. + 2018-09-05 Tom de Vries * gdb.dwarf2/varval.exp: Add test. diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp index 301cbae4952..0c17e9118a9 100644 --- a/gdb/testsuite/gdb.base/watchpoint.exp +++ b/gdb/testsuite/gdb.base/watchpoint.exp @@ -444,12 +444,12 @@ proc test_complex_watchpoint {} { # In particular, test that a watch of stack-based things # is deleted when the stack-based things go out of scope. # - gdb_test_no_output "disable" "disable in test_complex_watchpoint" + gdb_test_no_output "disable" "disable in test_complex_watchpoint, first time" gdb_test "break marker6" ".*Breakpoint.*" gdb_test "cont" "Continuing.*Breakpoint.*marker6 \\(\\).*" \ "continue to marker6" gdb_breakpoint [gdb_get_line_number "func2 breakpoint here"] - gdb_continue_to_breakpoint "func2 breakpoint here" + gdb_continue_to_breakpoint "func2 breakpoint here, first time" # Test a watch of a single stack-based variable, whose scope # is the function we're now in. This should auto-delete when @@ -478,7 +478,7 @@ proc test_complex_watchpoint {} { } } - gdb_continue_to_breakpoint "func2 breakpoint here" + gdb_continue_to_breakpoint "func2 breakpoint here, second time" # We should be in "func2" again now. Test a watch of an # expression which includes both a stack-based local and # something whose scope is larger than this invocation @@ -498,7 +498,7 @@ proc test_complex_watchpoint {} { # across any invocations of "func2", it should not auto- # delete. # - gdb_continue_to_breakpoint "func2 breakpoint here" + gdb_continue_to_breakpoint "func2 breakpoint here, third time" gdb_test "watch static_b" ".*\[Ww\]atchpoint \[0-9\]*: static_b" \ "set static local watch" gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: static_b.*" \ @@ -514,31 +514,35 @@ proc test_complex_watchpoint {} { # local to a recursing function should be bound only to that # one invocation, and should not trigger for other invocations. # - gdb_test "tbreak recurser" ".*breakpoint.*" - gdb_test "cont" "Continuing.*recurser.*" - gdb_test "next" "if \\(x > 0.*" "next past local_x initialization" - gdb_test "watch local_x" ".*\[Ww\]atchpoint \[0-9\]*: local_x" \ - "set local watch in recursive call" - gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_x.*New value = 2.*" \ - "trigger local watch in recursive call" - gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \ - "self-delete local watch in recursive call" + with_test_prefix "local_x" { + gdb_test "tbreak recurser" ".*breakpoint.*" + gdb_test "cont" "Continuing.*recurser.*" + gdb_test "next" "if \\(x > 0.*" "next past local_x initialization" + gdb_test "watch local_x" ".*\[Ww\]atchpoint \[0-9\]*: local_x" \ + "set local watch in recursive call" + gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_x.*New value = 2.*" \ + "trigger local watch in recursive call" + gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \ + "self-delete local watch in recursive call" + } # Repeat the preceding test, but this time use "recurser::local_x" as # the variable to track. - gdb_test "cont" "Continuing.*marker6.*" - gdb_test "tbreak recurser" ".*breakpoint.*" - gdb_test "cont" "Continuing.*recurser.*" - gdb_test "next" "if \\(x > 0.*" "next past local_x initialization" - gdb_test "watch recurser::local_x" ".*\[Ww\]atchpoint \[0-9\]*: recurser::local_x" \ - "set local watch in recursive call with explicit scope" - gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: recurser::local_x.*New value = 2.*" \ - "trigger local watch with explicit scope in recursive call" - gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \ - "self-delete local watch with explicit scope in recursive call (2)" + with_test_prefix "recurser::local_x" { + gdb_test "cont" "Continuing.*marker6.*" "continue to marker6" + gdb_test "tbreak recurser" ".*breakpoint.*" + gdb_test "cont" "Continuing.*recurser.*" "continue to recurser" + gdb_test "next" "if \\(x > 0.*" "next past local_x initialization" + gdb_test "watch recurser::local_x" ".*\[Ww\]atchpoint \[0-9\]*: recurser::local_x" \ + "set local watch in recursive call with explicit scope" + gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: recurser::local_x.*New value = 2.*" \ + "trigger local watch with explicit scope in recursive call" + gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \ + "self-delete local watch with explicit scope in recursive call (2)" + } # Disable everything so we can finish the program at full speed - gdb_test_no_output "disable" "disable in test_complex_watchpoint" + gdb_test_no_output "disable" "disable in test_complex_watchpoint, second time" if [target_info exists gdb,noresults] { return } -- 2.39.5