* [PATCH] Fix test failures when TUI is not enabled
@ 2024-08-09 8:47 Bernd Edlinger
2024-08-09 9:28 ` Tom de Vries
0 siblings, 1 reply; 7+ messages in thread
From: Bernd Edlinger @ 2024-08-09 8:47 UTC (permalink / raw)
To: gdb-patches
This adds some missing require allow_tui_tests.
When tui is not enabled those test cases do typically
fail, but most of them only after a long time-out:
FAIL: gdb.base/new-ui.exp: do_test_invalid_args: new-ui with tui
FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)
FAIL: gdb.base/wrap-line.exp: term=ansi: width-auto-detected: wrap (timeout)
FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: $gdb_width == $readline_width
FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: wrap (timeout)
FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: $gdb_width == $readline_width
FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: wrap (timeout)
FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: wrap
FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: prompt after wrap
FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap
FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap
---
gdb/testsuite/gdb.base/new-ui.exp | 8 +++++---
gdb/testsuite/gdb.base/wrap-line.exp | 1 +
gdb/testsuite/gdb.tui/wrap-line.exp | 1 +
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp
index 2dfcbf7e108..a56d213e527 100644
--- a/gdb/testsuite/gdb.base/new-ui.exp
+++ b/gdb/testsuite/gdb.base/new-ui.exp
@@ -184,9 +184,11 @@ proc_with_prefix do_test_invalid_args {} {
"new-ui with bad interpreter name"
# Test that the TUI cannot be used for a new UI.
- gdb_test "new-ui tui $extra_tty_name" \
- "interpreter 'tui' cannot be used with a new UI" \
- "new-ui with tui"
+ if [allow_tui_tests] {
+ gdb_test "new-ui tui $extra_tty_name" \
+ "interpreter 'tui' cannot be used with a new UI" \
+ "new-ui with tui"
+ }
# Test that we can continue working normally.
if ![runto_main] {
diff --git a/gdb/testsuite/gdb.base/wrap-line.exp b/gdb/testsuite/gdb.base/wrap-line.exp
index b0931a3bbb8..1a1b47410ee 100644
--- a/gdb/testsuite/gdb.base/wrap-line.exp
+++ b/gdb/testsuite/gdb.base/wrap-line.exp
@@ -18,6 +18,7 @@
# We set TERM on build, but we need to set it on host. That only works if
# build == host.
require {!is_remote host}
+require allow_tui_tests
# Test both ansi (no auto-wrap) and xterm (auto-wrap).
set terms {ansi xterm}
diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp
index 9cddcf14995..48a04ebc330 100644
--- a/gdb/testsuite/gdb.tui/wrap-line.exp
+++ b/gdb/testsuite/gdb.tui/wrap-line.exp
@@ -17,6 +17,7 @@
# Required for tuiterm.
require {!is_remote host}
+require allow_tui_tests
tuiterm_env
--
2.39.2
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Fix test failures when TUI is not enabled
2024-08-09 8:47 [PATCH] Fix test failures when TUI is not enabled Bernd Edlinger
@ 2024-08-09 9:28 ` Tom de Vries
2024-08-09 9:48 ` Bernd Edlinger
0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2024-08-09 9:28 UTC (permalink / raw)
To: Bernd Edlinger, gdb-patches
On 8/9/24 10:47, Bernd Edlinger wrote:
> This adds some missing require allow_tui_tests.
>
> When tui is not enabled those test cases do typically
> fail, but most of them only after a long time-out:
>
> FAIL: gdb.base/new-ui.exp: do_test_invalid_args: new-ui with tui
> FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)
> FAIL: gdb.base/wrap-line.exp: term=ansi: width-auto-detected: wrap (timeout)
> FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: $gdb_width == $readline_width
> FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: wrap (timeout)
> FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: $gdb_width == $readline_width
> FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: wrap (timeout)
> FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: wrap
> FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: prompt after wrap
> FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap
> FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap
> ---
Hi,
I disabled tui support using --disable-tui, and can't reproduce the
wrap-line fails you see.
Is it possible that you're running into "[gdb/testsuite, stub-termcap]
FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap
(timeout)" @ https://sourceware.org/bugzilla/show_bug.cgi?id=31201 ?
Anyway, adding require allow_tui_tests in those two test-cases looks wrong.
In the case of gdb.tui/wrap-line.exp, there is already a test that bails
out if TUI is unsupported, but still allows testing of things that
should work regardless.
In the case of gdb.base/wrap-line.exp, it's a test-case I added
specifically to test the behaviour of prompt wrapping in the CLI, not in
TUI, so requiring allow_tui_tests there is non-sensical.
The change in gdb.base/new-ui.exp LGTM. You could submit a v2 with just
that change.
Thanks,
- Tom
> gdb/testsuite/gdb.base/new-ui.exp | 8 +++++---
> gdb/testsuite/gdb.base/wrap-line.exp | 1 +
> gdb/testsuite/gdb.tui/wrap-line.exp | 1 +
> 3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.base/new-ui.exp b/gdb/testsuite/gdb.base/new-ui.exp
> index 2dfcbf7e108..a56d213e527 100644
> --- a/gdb/testsuite/gdb.base/new-ui.exp
> +++ b/gdb/testsuite/gdb.base/new-ui.exp
> @@ -184,9 +184,11 @@ proc_with_prefix do_test_invalid_args {} {
> "new-ui with bad interpreter name"
>
> # Test that the TUI cannot be used for a new UI.
> - gdb_test "new-ui tui $extra_tty_name" \
> - "interpreter 'tui' cannot be used with a new UI" \
> - "new-ui with tui"
> + if [allow_tui_tests] {
> + gdb_test "new-ui tui $extra_tty_name" \
> + "interpreter 'tui' cannot be used with a new UI" \
> + "new-ui with tui"
> + }
>
> # Test that we can continue working normally.
> if ![runto_main] {
> diff --git a/gdb/testsuite/gdb.base/wrap-line.exp b/gdb/testsuite/gdb.base/wrap-line.exp
> index b0931a3bbb8..1a1b47410ee 100644
> --- a/gdb/testsuite/gdb.base/wrap-line.exp
> +++ b/gdb/testsuite/gdb.base/wrap-line.exp
> @@ -18,6 +18,7 @@
> # We set TERM on build, but we need to set it on host. That only works if
> # build == host.
> require {!is_remote host}
> +require allow_tui_tests
>
> # Test both ansi (no auto-wrap) and xterm (auto-wrap).
> set terms {ansi xterm}
> diff --git a/gdb/testsuite/gdb.tui/wrap-line.exp b/gdb/testsuite/gdb.tui/wrap-line.exp
> index 9cddcf14995..48a04ebc330 100644
> --- a/gdb/testsuite/gdb.tui/wrap-line.exp
> +++ b/gdb/testsuite/gdb.tui/wrap-line.exp
> @@ -17,6 +17,7 @@
>
> # Required for tuiterm.
> require {!is_remote host}
> +require allow_tui_tests
>
> tuiterm_env
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] Fix test failures when TUI is not enabled
2024-08-09 9:28 ` Tom de Vries
@ 2024-08-09 9:48 ` Bernd Edlinger
2024-08-09 11:11 ` Bernd Edlinger
2024-08-09 11:17 ` Tom de Vries
0 siblings, 2 replies; 7+ messages in thread
From: Bernd Edlinger @ 2024-08-09 9:48 UTC (permalink / raw)
To: Tom de Vries, gdb-patches
On 8/9/24 11:28, Tom de Vries wrote:
> On 8/9/24 10:47, Bernd Edlinger wrote:
>> This adds some missing require allow_tui_tests.
>>
>> When tui is not enabled those test cases do typically
>> fail, but most of them only after a long time-out:
>>
>> FAIL: gdb.base/new-ui.exp: do_test_invalid_args: new-ui with tui
>> FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)
>> FAIL: gdb.base/wrap-line.exp: term=ansi: width-auto-detected: wrap (timeout)
>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: $gdb_width == $readline_width
>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: wrap (timeout)
>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: $gdb_width == $readline_width
>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: wrap (timeout)
>> FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: wrap
>> FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: prompt after wrap
>> FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap
>> FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap
>> ---
>
> Hi,
>
> I disabled tui support using --disable-tui, and can't reproduce the wrap-line fails you see.
>
> Is it possible that you're running into "[gdb/testsuite, stub-termcap] FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)" @ https://sourceware.org/bugzilla/show_bug.cgi?id=31201 ?
>
Yes, that could be the case.
I did not explicitly opt-out tui, I just did never care to install
e.g. libcurses etc. and the configure did the rest.
> Anyway, adding require allow_tui_tests in those two test-cases looks wrong.
>
Okay, but what is going on then?
> In the case of gdb.tui/wrap-line.exp, there is already a test that bails
> out if TUI is unsupported, but still allows testing of things that should work regardless.
>
> In the case of gdb.base/wrap-line.exp, it's a test-case I added specifically to test the behaviour of prompt wrapping in the CLI, not in TUI, so requiring allow_tui_tests there is non-sensical.
>
Well is there a better way to detect the issue without going into this long timeout,
or can it be fixed somehow?
> The change in gdb.base/new-ui.exp LGTM. You could submit a v2 with just that change.
>
OK, will do.
Thanks
Bernd.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix test failures when TUI is not enabled
2024-08-09 9:48 ` Bernd Edlinger
@ 2024-08-09 11:11 ` Bernd Edlinger
2024-08-09 11:17 ` Tom de Vries
1 sibling, 0 replies; 7+ messages in thread
From: Bernd Edlinger @ 2024-08-09 11:11 UTC (permalink / raw)
To: Tom de Vries, gdb-patches
On 8/9/24 11:48, Bernd Edlinger wrote:
> On 8/9/24 11:28, Tom de Vries wrote:
>> On 8/9/24 10:47, Bernd Edlinger wrote:
>>
>> I disabled tui support using --disable-tui, and can't reproduce the wrap-line fails you see.
>>
>> Is it possible that you're running into "[gdb/testsuite, stub-termcap] FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)" @ https://sourceware.org/bugzilla/show_bug.cgi?id=31201 ?
>>
>
> Yes, that could be the case.
>
> I did not explicitly opt-out tui, I just did never care to install
> e.g. libcurses etc. and the configure did the rest.
>
FYI this is what happens in the test:
PASS: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: $gdb_width == [expr $readline_width + 1]
PASS: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: width
print 1^M
$1 = 1^M
(gdb) 78901234567890123456789012345678901234567890123456789012345678901234567^M<890123456789012345678901234567890123456789012345678 ^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H^H9WFAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)
Quit^M
the input is long string and the output is
^M<890123456789012345678901234567890123456789012345678
+ some space characters + some backspace characters
and no (gdb) prompt. That is not what the test expects?
Thanks
Bernd.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix test failures when TUI is not enabled
2024-08-09 9:48 ` Bernd Edlinger
2024-08-09 11:11 ` Bernd Edlinger
@ 2024-08-09 11:17 ` Tom de Vries
2024-08-12 4:54 ` Bernd Edlinger
1 sibling, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2024-08-09 11:17 UTC (permalink / raw)
To: Bernd Edlinger, gdb-patches
On 8/9/24 11:48, Bernd Edlinger wrote:
> On 8/9/24 11:28, Tom de Vries wrote:
>> On 8/9/24 10:47, Bernd Edlinger wrote:
>>> This adds some missing require allow_tui_tests.
>>>
>>> When tui is not enabled those test cases do typically
>>> fail, but most of them only after a long time-out:
>>>
>>> FAIL: gdb.base/new-ui.exp: do_test_invalid_args: new-ui with tui
>>> FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)
>>> FAIL: gdb.base/wrap-line.exp: term=ansi: width-auto-detected: wrap (timeout)
>>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: $gdb_width == $readline_width
>>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: wrap (timeout)
>>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: $gdb_width == $readline_width
>>> FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: wrap (timeout)
>>> FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: wrap
>>> FAIL: gdb.tui/wrap-line.exp: width-hard-coded: cli: prompt after wrap
>>> FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: wrap
>>> FAIL: gdb.tui/wrap-line.exp: width-auto-detected: cli: prompt after wrap
>>> ---
>>
>> Hi,
>>
>> I disabled tui support using --disable-tui, and can't reproduce the wrap-line fails you see.
>>
>> Is it possible that you're running into "[gdb/testsuite, stub-termcap] FAIL: gdb.base/wrap-line.exp: term=ansi: width-hard-coded: wrap (timeout)" @ https://sourceware.org/bugzilla/show_bug.cgi?id=31201 ?
>>
>
> Yes, that could be the case.
>
> I did not explicitly opt-out tui, I just did never care to install
> e.g. libcurses etc. and the configure did the rest.
That sounds like you ran into that PR then.
>> Anyway, adding require allow_tui_tests in those two test-cases looks wrong.
>>
>
> Okay, but what is going on then?
>
We can get the same effect using "TERM=dumb gdb".
It forces readline's horizontal-scroll-mode to activate (unfortunately,
without affecting the value of the corresponding variable that we can
read with bind -v).
>> In the case of gdb.tui/wrap-line.exp, there is already a test that bails
>> out if TUI is unsupported, but still allows testing of things that should work regardless.
>>
>> In the case of gdb.base/wrap-line.exp, it's a test-case I added specifically to test the behaviour of prompt wrapping in the CLI, not in TUI, so requiring allow_tui_tests there is non-sensical.
>>
>
> Well is there a better way to detect the issue without going into this long timeout,
> or can it be fixed somehow?
>
We could accept the string produced by horizontal-scroll-mode and
produce an unsupported and bail out.
Thanks,
- Tom
>> The change in gdb.base/new-ui.exp LGTM. You could submit a v2 with just that change.
>>
>
> OK, will do.
>
> Thanks
> Bernd.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix test failures when TUI is not enabled
2024-08-09 11:17 ` Tom de Vries
@ 2024-08-12 4:54 ` Bernd Edlinger
2024-08-12 9:43 ` [PATCH] Fix test failures when tui " Bernd Edlinger
0 siblings, 1 reply; 7+ messages in thread
From: Bernd Edlinger @ 2024-08-12 4:54 UTC (permalink / raw)
To: Tom de Vries, gdb-patches
On 8/9/24 13:17, Tom de Vries wrote:
>
> That sounds like you ran into that PR then.
>
>>> Anyway, adding require allow_tui_tests in those two test-cases looks wrong.
>>>
>>
>> Okay, but what is going on then?
>>
>
> We can get the same effect using "TERM=dumb gdb".
>
> It forces readline's horizontal-scroll-mode to activate (unfortunately, without affecting the value of the corresponding variable that we can read with bind -v).
>
>>> In the case of gdb.tui/wrap-line.exp, there is already a test that bails
>>> out if TUI is unsupported, but still allows testing of things that should work regardless.
>>>
>>> In the case of gdb.base/wrap-line.exp, it's a test-case I added specifically to test the behaviour of prompt wrapping in the CLI, not in TUI, so requiring allow_tui_tests there is non-sensical.
>>>
>>
>> Well is there a better way to detect the issue without going into this long timeout,
>> or can it be fixed somehow?
>>
>
> We could accept the string produced by horizontal-scroll-mode and produce an unsupported and bail out.
>
Hmm...,
--- a/gdb/testsuite/gdb.base/wrap-line.exp
+++ b/gdb/testsuite/gdb.base/wrap-line.exp
@@ -115,6 +115,9 @@ proc test_wrap { width_auto_detected } {
-re $re {
pass $gdb_test_name
}
+ -re "\r<.*" {
+ unsupported $gdb_test_name
+ }
}
# Generate a prompt.
This works as expected, but I see no way how to do the same
in gdb.tui/wrap-line.exp because the
... and other than that there is also
FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: $gdb_width == $readline_width
FAIL: gdb.base/wrap-line.exp: term=xterm: width-auto-detected: $gdb_width == $readline_width
(gdb) PASS: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: set width 80
show editing^M
Editing of command lines as they are typed is on.^M
(gdb) maint info screen^M
Number of characters gdb thinks are in a line is 80.^M
Number of characters readline reports are in a line is 79.^M
Number of characters environment thinks are in a line is 80 (COLUMNS).^M
Number of lines gdb thinks are in a page is 4294967295 (unlimited).^M
Number of lines readline reports are in a page is 32767 (unlimited).^M
Number of lines environment thinks are in a page is 25 (LINES).^M
(gdb) PASS: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: maint info screen
FAIL: gdb.base/wrap-line.exp: term=xterm: width-hard-coded: $gdb_width == $readline_width
I wonder whether that can be used to detect this situation,
when bind -v is not able to it?
Thanks
Bernd.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-08-12 9:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-09 8:47 [PATCH] Fix test failures when TUI is not enabled Bernd Edlinger
2024-08-09 9:28 ` Tom de Vries
2024-08-09 9:48 ` Bernd Edlinger
2024-08-09 11:11 ` Bernd Edlinger
2024-08-09 11:17 ` Tom de Vries
2024-08-12 4:54 ` Bernd Edlinger
2024-08-12 9:43 ` [PATCH] Fix test failures when tui " Bernd Edlinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox