diff options
author | Guinevere Larsen <blarsen@redhat.com> | 2023-07-26 10:08:10 +0200 |
---|---|---|
committer | Guinevere Larsen <blarsen@redhat.com> | 2023-12-01 13:29:40 +0100 |
commit | fbd9e35c5436108732575e82e78cc42be5ba52f5 (patch) | |
tree | eba10f758b97399d7e8340a4ae97767374891418 /sim | |
parent | d7ac0027a4419b85cd6db4c6fc84d287e34f84a9 (diff) | |
download | fsf-binutils-gdb-fbd9e35c5436108732575e82e78cc42be5ba52f5.zip fsf-binutils-gdb-fbd9e35c5436108732575e82e78cc42be5ba52f5.tar.gz fsf-binutils-gdb-fbd9e35c5436108732575e82e78cc42be5ba52f5.tar.bz2 |
gdb/testsuite: fix completion tests when using READ1
The commit a3da2e7e550c4fe79128b5e532dbb90df4d4f418 has introduced
regressions when testing using the READ1 mechanism. The reason for that
is the new failure path in proc test_gdb_complete_tab_unique, which
looks for GDB suggesting more than what the test inputted, but not the
correct answer, followed by a white space. Consider the following case:
int foo(int bar, int baz);
Sending the command "break foo<tab>" to GDB will return
break foo(int, int)
which easily fits the buffer in normal testing, so everything works, but
when reading one character at a time, the test will find the partial
"break foo(int, " and assume that there was a mistake, so we get a
spurious FAIL.
That change was added because we wanted to avoid forcing a completion
failure to fail through timeout, which it had to do because there is no
way to verify that the output is done, mostly because when I was trying
to solve a different problem I kept getting reading errors and testing
completion was frustrating.
This commit implements a better way to avoid that frustration, by first
testing gdb's complete command and only if that passes we will test tab
completion. The difference is that when testing with the complete
command, we can tell when the output is over when we receive the GDB
prompt again, so we don't need to rely on timeouts. With this, the
change to test_gdb_complete_tab_unique has been removed as that test
will only be run and fail in the very unlikely scenario that tab
completion is different than command completion.
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'sim')
0 files changed, 0 insertions, 0 deletions