[patch] gdb/testsuite: Adjust command completion output when TUI is disabled
Andrew Burgess
andrew.burgess@embecosm.com
Tue Jun 23 08:39:45 GMT 2020
* Sandra Loosemore <sandra@codesourcery.com> [2020-06-23 00:27:45 -0600]:
> This is another almost-obvious testsuite fix, for one of the
> command-completion tests that was failing due to an incorrect assumption
> that TUI commands are always present. OK to commit, or is this just a
> poorly-designed testcase that we should rewrite some other way instead?
>
> -Sandra
> commit 8e0cc2870a30390e745110d4c8181f010d09c17f
> Author: Sandra Loosemore <sandra@codesourcery.com>
> Date: Mon Jun 22 23:01:19 2020 -0700
>
> Adjust command completion output when TUI is disabled
>
> The history-scrolling commands "+", "-", "<" and ">" are only known to
> GDB when TUI is enabled. This means the "complete pipe " command
> produces different output depending on whether TUI is present, which
> in turn caused
>
> FAIL: gdb.base/shell.exp: cmd complete "pipe "
>
> This patch provides different patterns for that test depending on
> whether or not TUI is available.
>
> 2020-06-23 Sandra Loosemore <sandra@codesourcery.com>
>
> gdb/testsuite/
> * lib/completion-support.exp (test_gdb_completion_offers_commands):
> Adjust for omitted commands when TUI is disabled.
LGTM.
Thanks,
Andrew
>
> diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
> index d6c43e6..38f2188 100644
> --- a/gdb/testsuite/ChangeLog
> +++ b/gdb/testsuite/ChangeLog
> @@ -1,3 +1,8 @@
> +2020-06-23 Sandra Loosemore <sandra@codesourcery.com>
> +
> + * lib/completion-support.exp (test_gdb_completion_offers_commands):
> + Adjust for omitted commands when TUI is disabled.
> +
> 2020-06-22 Philippe Waroquiers <philippe.waroquiers@skynet.be>
>
> * gdb.base/default-args.exp: New test.
> diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp
> index 18eac82..51436cc 100644
> --- a/gdb/testsuite/lib/completion-support.exp
> +++ b/gdb/testsuite/lib/completion-support.exp
> @@ -555,10 +555,19 @@ proc test_gdb_completion_offers_commands {input_line} {
> # Force showing two commands.
> gdb_test_no_output "set max-completions 2" ""
>
> - test_gdb_complete_multiple $input_line "" "" {
> - "!"
> - "+"
> - } "" "" 1
> + # TUI adds additional commands to the possible completions, so we
> + # need different patterns depending on whether or not it is enabled.
> + if { [skip_tui_tests] } {
> + test_gdb_complete_multiple $input_line "" "" {
> + "!"
> + "actions"
> + } "" "" 1
> + } else {
> + test_gdb_complete_multiple $input_line "" "" {
> + "!"
> + "+"
> + } "" "" 1
> + }
>
> # Restore.
> gdb_test_no_output "set max-completions $max_completions" ""
More information about the Gdb-patches
mailing list