[gdb/testsuite] Set EDITOR to true before using edit
authorTom de Vries <tdevries@suse.de>
Wed, 11 Mar 2020 07:37:04 +0000 (08:37 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 11 Mar 2020 07:37:04 +0000 (08:37 +0100)
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.

gdb/testsuite/ChangeLog:

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

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

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/list-ambiguous.exp

index c5aa0e6705379f54993750039972c8078ac49667..46442c5e12f5e1faa5e431b5e20feb95dbea0bfb 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-11  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.base/list-ambiguous.exp: Set EDITOR to true.
+
 2020-03-11  Tom de Vries  <tdevries@suse.de>
 
        * gdb.ada/access_to_packed_array.exp: Test printing of expanded
index 8d63938fb77996488859051c802adaca5005c8e2..13c15d2893cfcb745873de29995dba18b1697a12 100644 (file)
 
 standard_testfile list-ambiguous0.c list-ambiguous1.c
 
+# Set EDITOR to true to prevent that GDB's edit command starts an actual
+# editor.
+setenv EDITOR true
+
 if {[prepare_for_testing "failed to prepare" $testfile [list $srcfile $srcfile2] \
         {debug}]} {
     return -1
This page took 0.032727 seconds and 4 git commands to generate.