Re: [PATCH v2 2/8] Fix test names starting with uppercase using gdb_test on a single line.

Yao Qi
2016-11-27T16:48:19Z

On Fri, Nov 25, 2016 at 02:53:58PM -0600, Luis Machado wrote:
> This fixes offender testcases that have test names starting with uppercase
> when using gdb_test in a single line construct.
>
> gdb/testsuite/ChangeLog
> 2016-11-25 Luis Machado <lgustavo@codesourcery.com>
>
> Fix test names starting with uppercase throughout the files.
>
> * gdb/testsuite/gdb.arch/i386-mpx-simple_segv.exp
> * gdb/testsuite/gdb.arch/i386-mpx.exp
> * gdb/testsuite/gdb.arch/i386-permbkpt.exp
> * gdb/testsuite/gdb.arch/pa-nullify.exp
> * gdb/testsuite/gdb.arch/powerpc-d128-regs.exp
> * gdb/testsuite/gdb.arch/vsx-regs.exp
> * gdb/testsuite/gdb.base/bfp-test.exp
> * gdb/testsuite/gdb.base/break.exp
> * gdb/testsuite/gdb.base/breakpoint-shadow.exp
> * gdb/testsuite/gdb.base/callfuncs.exp
> * gdb/testsuite/gdb.base/charset.exp
> * gdb/testsuite/gdb.base/commands.exp
> * gdb/testsuite/gdb.base/completion.exp
> * gdb/testsuite/gdb.base/dfp-test.exp
> * gdb/testsuite/gdb.base/echo.exp
> * gdb/testsuite/gdb.base/ending-run.exp
> * gdb/testsuite/gdb.base/eval.exp
> * gdb/testsuite/gdb.base/expand-psymtabs.exp
> * gdb/testsuite/gdb.base/float128.exp
> * gdb/testsuite/gdb.base/floatn.exp
> * gdb/testsuite/gdb.base/foll-exec-mode.exp
> * gdb/testsuite/gdb.base/gdb1056.exp
> * gdb/testsuite/gdb.base/gdb11531.exp
> * gdb/testsuite/gdb.base/kill-after-signal.exp
> * gdb/testsuite/gdb.base/multi-forks.exp
> * gdb/testsuite/gdb.base/overlays.exp
> * gdb/testsuite/gdb.base/pending.exp
> * gdb/testsuite/gdb.base/sepdebug.exp
> * gdb/testsuite/gdb.base/testenv.exp
> * gdb/testsuite/gdb.base/valgrind-db-attach.exp
> * gdb/testsuite/gdb.base/watch_thread_num.exp
> * gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
> * gdb/testsuite/gdb.base/watchpoint.exp
> * gdb/testsuite/gdb.base/watchpoints.exp
> * gdb/testsuite/gdb.cp/arg-reference.exp
> * gdb/testsuite/gdb.cp/baseenum.exp
> * gdb/testsuite/gdb.cp/operator.exp
> * gdb/testsuite/gdb.cp/shadow.exp
> * gdb/testsuite/gdb.dwarf2/dw2-op-out-param.exp
> * gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp
> * gdb/testsuite/gdb.go/chan.exp
> * gdb/testsuite/gdb.go/hello.exp
> * gdb/testsuite/gdb.go/integers.exp
> * gdb/testsuite/gdb.go/methods.exp
> * gdb/testsuite/gdb.go/package.exp
> * gdb/testsuite/gdb.guile/scm-parameter.exp
> * gdb/testsuite/gdb.guile/scm-progspace.exp
> * gdb/testsuite/gdb.guile/scm-value.exp
> * gdb/testsuite/gdb.mi/mi-pending.exp
> * gdb/testsuite/gdb.mi/user-selected-context-sync.exp
> * gdb/testsuite/gdb.multi/multi-attach.exp
> * gdb/testsuite/gdb.multi/tids.exp
> * gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
> * gdb/testsuite/gdb.pascal/floats.exp
> * gdb/testsuite/gdb.pascal/integers.exp
> * gdb/testsuite/gdb.python/py-block.exp
> * gdb/testsuite/gdb.python/py-events.exp
> * gdb/testsuite/gdb.python/py-finish-breakpoint2.exp
> * gdb/testsuite/gdb.python/py-parameter.exp
> * gdb/testsuite/gdb.python/py-symbol.exp
> * gdb/testsuite/gdb.python/py-symtab.exp
> * gdb/testsuite/gdb.python/py-type.exp
> * gdb/testsuite/gdb.python/py-value.exp
> * gdb/testsuite/gdb.python/py-xmethods.exp
> * gdb/testsuite/gdb.python/python.exp
> * gdb/testsuite/gdb.reverse/break-precsave.exp
> * gdb/testsuite/gdb.reverse/consecutive-precsave.exp
> * gdb/testsuite/gdb.reverse/finish-precsave.exp
> * gdb/testsuite/gdb.reverse/i386-precsave.exp
> * gdb/testsuite/gdb.reverse/machinestate-precsave.exp
> * gdb/testsuite/gdb.reverse/sigall-precsave.exp
> * gdb/testsuite/gdb.reverse/solib-precsave.exp
> * gdb/testsuite/gdb.reverse/step-precsave.exp
> * gdb/testsuite/gdb.reverse/until-precsave.exp
> * gdb/testsuite/gdb.reverse/watch-precsave.exp
> * gdb/testsuite/gdb.server/ext-attach.exp
> * gdb/testsuite/gdb.server/ext-restart.exp
> * gdb/testsuite/gdb.server/ext-run.exp
> * gdb/testsuite/gdb.server/ext-wrapper.exp
> * gdb/testsuite/gdb.stabs/gdb11479.exp
> * gdb/testsuite/gdb.stabs/weird.exp
> * gdb/testsuite/gdb.threads/attach-many-short-lived-threads.exp
> * gdb/testsuite/gdb.threads/kill.exp
> * gdb/testsuite/gdb.threads/watchpoint-fork.exp

Drop "gdb/testsuite/".

> # test break at line number in file
> @@ -670,7 +670,7 @@ proc test_next_with_recursion {} {
> global decimal
> global binfile
>
> - gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y"
> + gdb_test "kill" "" "kill program" "kill the program being debugged.*y or n. $" "y"

"Kill the program" is to be matched to the output of GDB, so this change
is not needed. There are some instances of this problem in this patch.

> delete_breakpoints
>
> gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial"
>

> diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp
> index 4181bec..69b27e7 100644
> --- a/gdb/testsuite/gdb.base/kill-after-signal.exp
> +++ b/gdb/testsuite/gdb.base/kill-after-signal.exp
> @@ -37,4 +37,4 @@ if ![runto_main] {
>
> gdb_test "continue" "Program received signal SIGUSR1, .*"
> gdb_test "stepi" "\r\nhandler .*"
> -gdb_test "kill" "^y" "kill" "Kill the program being debugged\\? \\(y or n\\) $" "y"
> +gdb_test "kill" "^y" "kill" "kill the program being debugged\\? \\(y or n\\) $" "y"

Likewise.

> # test break at function in file
> @@ -480,7 +480,7 @@ proc test_next_with_recursion {} {
> global decimal
> global binfile
>
> - gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y"
> + gdb_test "kill" "" "kill program" "kill the program being debugged.*y or n. $" "y"
> delete_breakpoints
>

Likewise.

> # Explicitly kill the program so it doesn't dump core when we quit->detach.
> -gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y"
> +gdb_test "kill" "" "kill program" "kill the program being debugged.*y or n. $" "y"

Likewise.

> -gdb_test "kill" "" "kill inferior 2" "Kill the program being debugged.*" "y"
> +gdb_test "kill" "" "kill inferior 2" "kill the program being debugged.*" "y"
> gdb_test "inferior 1" ".*Switching to inferior 1.*"
> -gdb_test "kill" "" "kill inferior 1" "Kill the program being debugged.*" "y"
> +gdb_test "kill" "" "kill inferior 1" "kill the program being debugged.*" "y"

Likewise.

> kill_wait_spawned_process $test_spawn_id1
> kill_wait_spawned_process $test_spawn_id2
> diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
> index 12ce98a..4808b0d 100644
> --- a/gdb/testsuite/gdb.multi/tids.exp
> +++ b/gdb/testsuite/gdb.multi/tids.exp
> @@ -409,7 +409,7 @@ if { ![skip_python_tests] } {
> # Remove the second inferior and confirm that GDB goes back to showing
> # single-number thread IDs.
> with_test_prefix "back to one inferior" {
> - gdb_test "kill inferior 2" "" "kill inferior 2" "Kill the program being debugged.*" "y"
> + gdb_test "kill inferior 2" "" "kill inferior 2" "kill the program being debugged.*" "y"
> gdb_test "thread 1.1" "Switching to thread 1\.1 .*"
> gdb_test "remove-inferior 2" ".*" "remove inferior 2"
>

Likewise.

> -gdb_test "continue" ".*exception did not finish.*" "FinishBreakpoint with exception thrown not caught"
> +gdb_test "continue" ".*exception did not finish.*" "finishBreakpoint with exception thrown not caught"

FinishBreakpoint should be kept as-is, IMO, or we can rewrite the
message like "exception thrown not caught".

> diff --git a/gdb/testsuite/gdb.server/ext-restart.exp b/gdb/testsuite/gdb.server/ext-restart.exp
> index b21c7c5..035686c 100644
> --- a/gdb/testsuite/gdb.server/ext-restart.exp
> +++ b/gdb/testsuite/gdb.server/ext-restart.exp
> @@ -60,6 +60,6 @@ with_test_prefix "restart" {
> }
> }
>
> -gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
> +gdb_test "kill" "" "kill" "kill the program being debugged.*" "y"
>

Likewise.

> --- a/gdb/testsuite/gdb.server/ext-wrapper.exp
> +++ b/gdb/testsuite/gdb.server/ext-wrapper.exp
> @@ -65,6 +65,6 @@ with_test_prefix "restart" {
> gdb_test "print d" "\\$${decimal} = ${hex} \"1\".*"
> }
>
> -gdb_test "kill" "" "kill" "Kill the program being debugged.*" "y"
> +gdb_test "kill" "" "kill" "kill the program being debugged.*" "y"
>

> gdb_test "detach" "Detaching from.*"
> } else {
> - gdb_test "kill" "" "kill process" "Kill the program being debugged.*y or n. $" "y"
> + gdb_test "kill" "" "kill process" "kill the program being debugged.*y or n. $" "y"
> }
>
> gdb_test_no_output "set breakpoint always-inserted off"
> diff --git a/gdb/testsuite/gdb.threads/kill.exp b/gdb/testsuite/gdb.threads/kill.exp
> index a6d8382..bc00914 100644
> --- a/gdb/testsuite/gdb.threads/kill.exp
> +++ b/gdb/testsuite/gdb.threads/kill.exp
> @@ -68,7 +68,7 @@ proc test {threaded} {
> #
> # the above would mean that the remote end crashed.
>
> - gdb_test "kill" "^y" "kill program" "Kill the program being debugged\\? \\(y or n\\) $" "y"
> + gdb_test "kill" "^y" "kill program" "kill the program being debugged\\? \\(y or n\\) $" "y"
> }
> }
>

Otherwise, patch is good to me.

--
Yao