This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix gdb.tui/completion.exp test
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 15 Nov 2017 16:07:44 -0000
- Subject: [binutils-gdb] Fix gdb.tui/completion.exp test
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=71774bc994e3f2a09c3b1988dbf2e99b86f53e2e
commit 71774bc994e3f2a09c3b1988dbf2e99b86f53e2e
Author: Simon Marchi <simon.marchi@ericsson.com>
Date: Wed Nov 15 11:07:02 2017 -0500
Fix gdb.tui/completion.exp test
When I run it locally, the test gdb.tui/completion.exp test fails
because of a timeout:
Running /home/emaisin/src/binutils-gdb/gdb/testsuite/gdb.tui/completion.exp ...
FAIL: gdb.tui/completion.exp: completion of layout names: tab completion (timeout)
The problem seems to be this regex, which confirms that after doing
layout<TAB>, "layout" is printed again after the gdb prompt:
-re "^$input_line$"
The problem is that there's a trailing space in the output after
"layout". Since the regex has an anchored end (the $), it doesn't
match. Adding a space fixes the test.
gdb/testsuite/ChangeLog:
* gdb.tui/completionn.exp (test_tab_completion): Add space in
regex.
Diff:
---
gdb/testsuite/ChangeLog | 5 +++++
gdb/testsuite/gdb.tui/completion.exp | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 8c57179..bb8dd79 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-11-15 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdb.tui/completionn.exp (test_tab_completion): Add space in
+ regex.
+
2017-11-13 Simon Marchi <simon.marchi@polymtl.ca>
* gdb.opt/inline-locals.exp: Remove trailing parentheses from
diff --git a/gdb/testsuite/gdb.tui/completion.exp b/gdb/testsuite/gdb.tui/completion.exp
index f53a244..426b6bf 100644
--- a/gdb/testsuite/gdb.tui/completion.exp
+++ b/gdb/testsuite/gdb.tui/completion.exp
@@ -32,7 +32,7 @@ proc test_tab_completion {input_line expected_re} {
gdb_test_multiple "" "$test" {
-re "$expected_re\r\n$gdb_prompt " {
gdb_test_multiple "" "$test" {
- -re "^$input_line$" {
+ -re "^$input_line $" {
pass "$test"
}
}