public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Set EDITOR to true before using edit
@ 2020-03-10 16:32 Tom de Vries
  2020-03-11  0:05 ` Tom Tromey
  2020-03-11  5:10 ` Simon Marchi
  0 siblings, 2 replies; 3+ messages in thread
From: Tom de Vries @ 2020-03-10 16:32 UTC (permalink / raw)
  To: gdb-patches

Hi,

The test-case gdb.base/list-ambiguous.exp normally passes, but with target
board readnow, some tests fail.

In particular, for this test, edit doesn't fail as expected:
...
    # While at it, test the "edit" command as well, since it shares
    # code with "list".
    gdb_test "edit $symbol" \
        "Specified line is ambiguous:\r\n${h0_re}\r\n${h1_re}"
...
and the editor is launched, in my case:
...
$ echo $EDITOR
/home/vries/bin/emacs-nw.sh
...
which result in all subsequent tests failing with timeout, and an editor
backup file in my sources:
...
$ git status --ignored
On branch master
Ignored files:
  (use "git add -f <file>..." to include in what will be committed)

        gdb/testsuite/gdb.base/#list-ambiguous0.c#

nothing to commit, working tree clean
...

Fix this by setting EDITOR to true before starting gdb in this test-case.

Tested on x86_64-linux.

OK for trunk?

Thanks,
- Tom

[gdb/testsuite] Set EDITOR to true before using edit

gdb/testsuite/ChangeLog:

2020-03-10  Tom de Vries  <tdevries@suse.de>

	* gdb.base/list-ambiguous.exp: Set EDITOR to true.

---
 gdb/testsuite/gdb.base/list-ambiguous.exp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/testsuite/gdb.base/list-ambiguous.exp b/gdb/testsuite/gdb.base/list-ambiguous.exp
index 8d63938fb7..0c89bba3a1 100644
--- a/gdb/testsuite/gdb.base/list-ambiguous.exp
+++ b/gdb/testsuite/gdb.base/list-ambiguous.exp
@@ -18,6 +18,8 @@
 
 standard_testfile list-ambiguous0.c list-ambiguous1.c
 
+setenv EDITOR true
+
 if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
 	 {debug}]} {
     return -1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][gdb/testsuite] Set EDITOR to true before using edit
  2020-03-10 16:32 [PATCH][gdb/testsuite] Set EDITOR to true before using edit Tom de Vries
@ 2020-03-11  0:05 ` Tom Tromey
  2020-03-11  5:10 ` Simon Marchi
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2020-03-11  0:05 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> [gdb/testsuite] Set EDITOR to true before using edit

Tom> gdb/testsuite/ChangeLog:

Tom> 2020-03-10  Tom de Vries  <tdevries@suse.de>

Tom> 	* gdb.base/list-ambiguous.exp: Set EDITOR to true.

Thanks, this is ok.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][gdb/testsuite] Set EDITOR to true before using edit
  2020-03-10 16:32 [PATCH][gdb/testsuite] Set EDITOR to true before using edit Tom de Vries
  2020-03-11  0:05 ` Tom Tromey
@ 2020-03-11  5:10 ` Simon Marchi
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2020-03-11  5:10 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 2020-03-10 12:32 p.m., Tom de Vries wrote:
> Hi,
> 
> The test-case gdb.base/list-ambiguous.exp normally passes, but with target
> board readnow, some tests fail.
> 
> In particular, for this test, edit doesn't fail as expected:
> ...
>     # While at it, test the "edit" command as well, since it shares
>     # code with "list".
>     gdb_test "edit $symbol" \
>         "Specified line is ambiguous:\r\n${h0_re}\r\n${h1_re}"
> ...
> and the editor is launched, in my case:
> ...
> $ echo $EDITOR
> /home/vries/bin/emacs-nw.sh
> ...
> which result in all subsequent tests failing with timeout, and an editor
> backup file in my sources:
> ...
> $ git status --ignored
> On branch master
> Ignored files:
>   (use "git add -f <file>..." to include in what will be committed)
> 
>         gdb/testsuite/gdb.base/#list-ambiguous0.c#
> 
> nothing to commit, working tree clean
> ...
> 
> Fix this by setting EDITOR to true before starting gdb in this test-case.
> 
> Tested on x86_64-linux.
> 
> OK for trunk?
> 
> Thanks,
> - Tom
> 
> [gdb/testsuite] Set EDITOR to true before using edit
> 
> gdb/testsuite/ChangeLog:
> 
> 2020-03-10  Tom de Vries  <tdevries@suse.de>
> 
> 	* gdb.base/list-ambiguous.exp: Set EDITOR to true.
> 
> ---
>  gdb/testsuite/gdb.base/list-ambiguous.exp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.base/list-ambiguous.exp b/gdb/testsuite/gdb.base/list-ambiguous.exp
> index 8d63938fb7..0c89bba3a1 100644
> --- a/gdb/testsuite/gdb.base/list-ambiguous.exp
> +++ b/gdb/testsuite/gdb.base/list-ambiguous.exp
> @@ -18,6 +18,8 @@
>  
>  standard_testfile list-ambiguous0.c list-ambiguous1.c
>  
> +setenv EDITOR true
> +
>  if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
>  	 {debug}]} {
>      return -1
> 

That's a fun one :).

This is fine, but please add a comment on top of your setenv to explain why
it's there.

Simon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-11  5:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 16:32 [PATCH][gdb/testsuite] Set EDITOR to true before using edit Tom de Vries
2020-03-11  0:05 ` Tom Tromey
2020-03-11  5:10 ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).