summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-05-27 19:59:19 +0100
committerPedro Alves <palves@redhat.com>2020-05-27 19:59:19 +0100
commit636edd0018b72d67ee224e868fb277a658e9b984 (patch)
tree9267b4ee6d4f08646586bf3ef22692c59adbbf5e
parentf0fbb768c223fd65385e2e2380fd04fde7121e5e (diff)
downloadbinutils-gdb-636edd0018b72d67ee224e868fb277a658e9b984.tar.gz
cp-completion-aliases.exp: Use test_gdb_complete_{unique,multiple}
gdb.linespec/cp-completion-aliases.exp is calling test_gdb_complete_{tab,cmd}_unique and test_gdb_complete_{tab,cmd}_multiple separately for each use case. I.e., testing once for TAB completion and once for the "complete" command. There's no need to do that explicitly and separately, we have wrapper procedures to do that for us. gdb/testsuite/ChangeLog: 2020-05-27 Pedro Alves <palves@redhat.com> * gdb.linespec/cp-completion-aliases.exp: Remove readline_is_used check. Use test_gdb_complete_unique instead of test_gdb_complete_tab_unique + test_gdb_complete_cmd_unique. Use test_gdb_complete_multiple instead of test_gdb_complete_tab_multiple + test_gdb_complete_cmd_multiple.
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.linespec/cp-completion-aliases.exp33
2 files changed, 18 insertions, 23 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index eb0c7994035..41224f9db29 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2020-05-27 Pedro Alves <palves@redhat.com>
+
+ * gdb.linespec/cp-completion-aliases.exp: Remove readline_is_used
+ check. Use test_gdb_complete_unique instead of
+ test_gdb_complete_tab_unique + test_gdb_complete_cmd_unique. Use
+ test_gdb_complete_multiple instead of
+ test_gdb_complete_tab_multiple + test_gdb_complete_cmd_multiple.
+
2020-05-27 Luis Machado <luis.machado@linaro.org>
* gdb.arch/aarch64-sighandler-regs.exp: Fix duplicated test names.
diff --git a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
index 313ff844b36..7b67abe6afb 100644
--- a/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
+++ b/gdb/testsuite/gdb.linespec/cp-completion-aliases.exp
@@ -24,31 +24,18 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug}]} {
return -1
}
-# Tests below are about tab-completion, which doesn't work if readline
-# library isn't used. Check it first.
-
-if { ![readline_is_used] } {
- untested "no tab completion support without readline"
- return -1
-}
-
# Disable the completion limit for the whole testcase.
gdb_test_no_output "set max-completions unlimited"
-test_gdb_complete_tab_unique "break get_v" \
- "break get_value\\(object_p\\)" " "
+test_gdb_complete_unique \
+ "break get_v" \
+ "break get_value(object_p)"
-test_gdb_complete_cmd_unique "break get_v" \
- "break get_value\\(object_p\\)"
+test_gdb_complete_unique \
+ "break gr" \
+ "break grab_it(int_magic_t*)"
-test_gdb_complete_tab_unique "break gr" \
- "break grab_it\\(int_magic_t\\*\\)" " "
-
-test_gdb_complete_cmd_unique "break gr" \
- "break grab_it\\(int_magic_t\\*\\)"
-
-test_gdb_complete_tab_multiple "break get_som" "ething(" \
- { "get_something(my_string_t)" "get_something(object_p)" }
-
-test_gdb_complete_cmd_multiple "break " "get_som" \
- { "get_something(my_string_t)" "get_something(object_p)" }
+test_gdb_complete_multiple "break " "get_som" "ething(" {
+ "get_something(my_string_t)"
+ "get_something(object_p)"
+}