[testsuite] skip tab-completion tests if no readline
Commit Message
On 09/19/2018 06:56 AM, Tom Tromey wrote:
> [snip]
>
> Perhaps the early returns should call "untested". I'm on the fence
> about this, sometimes it is done, sometimes not. I don't know if it
> matters to anybody -- I never really look at these lines.
>
> https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#A.22untested.22_calls
>
> Second, this particular check runs early. I wonder if readline_is_used
> actually works at this spot, because I would imagine gdb isn't running yet.
> What does "runtest cpls-ops.exp" do?
Ooops, my bad. :-( I'd checked that the failures went away, but hadn't
looked closely at the logs to see that it was complaining about an error
there.
I've fixed it by moving the check after gdb is started, and also added
the "untested" calls. This is the version of the patch I've checked in.
-Sandra
commit 4ee9b0c53a8055b869dfe424846bc00eb0cd0c8f
Author: Sandra Loosemore <sandra@codesourcery.com>
Date: Wed Sep 19 19:05:39 2018 -0700
Skip GDB tab-completion tests if no readline.
2018-09-18 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* gdb.base/complete-empty.exp: Skip tab-completion tests if
no readline.
* gdb.base/utf8-identifiers.exp: Likewise.
* gdb.cp/cpcompletion.exp: Likewise.
* gdb.linespec/cpcompletion.exp: Likewise.
* gdb.linespec/cpls-abi-tag.exp: Likewise.
* gdb.linespec/cpls-ops.exp: Likewise.
@@ -1,3 +1,13 @@
+2018-09-18 Sandra Loosemore <sandra@codesourcery.com>
+
+ * gdb.base/complete-empty.exp: Skip tab-completion tests if
+ no readline.
+ * gdb.base/utf8-identifiers.exp: Likewise.
+ * gdb.cp/cpcompletion.exp: Likewise.
+ * gdb.linespec/cpcompletion.exp: Likewise.
+ * gdb.linespec/cpls-abi-tag.exp: Likewise.
+ * gdb.linespec/cpls-ops.exp: Likewise.
+
2018-09-19 Richard Bunt <richard.bunt@arm.com>
Chris January <chris.january@arm.com>
@@ -20,6 +20,14 @@ load_lib completion-support.exp
gdb_exit
gdb_start
+# 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
+}
+
# Start of tests.
# Test TAB with no input.
@@ -56,6 +56,14 @@ gdb_test "continue" \
# names getting in the way of completion.
gdb_test_no_output "nosharedlibrary"
+# 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
+}
+
# Test linespec completion.
# A unique completion.
@@ -59,6 +59,14 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
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
+}
+
# Test that completion is restricted by class name (all methods)
test_class_complete Foo "" "complete class methods" \
[list Foo Foofoo get_foo set_foo ~Foo]
@@ -24,6 +24,14 @@ if {[prepare_for_testing "failed to prepare" $testfile \
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"
@@ -26,6 +26,14 @@ if {[prepare_for_testing "failed to prepare" $testfile \
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
+}
+
gdb_test_no_output "set max-completions unlimited"
# Check that the explicit location completer manages to find the next
@@ -24,6 +24,14 @@ if {[prepare_for_testing "failed to prepare" $testfile \
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
+}
+
gdb_test_no_output "set max-completions unlimited"
# Check that the explicit location completer manages to find the next