]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change gdb test suite's TERM setting
authorTom Tromey <tom@tromey.com>
Tue, 13 Nov 2018 18:59:03 +0000 (11:59 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 28 Dec 2018 19:49:48 +0000 (12:49 -0700)
This changes the gdb test suite to set TERM to "dumb" by default.
This setting disables terminal styling, so that the existing tests do
not need to be updated.

gdb/testsuite/ChangeLog
2018-12-28  Tom Tromey  <tom@tromey.com>

* lib/gdb.exp (gdb_init): Set the TERM environment variable to
"dumb".
* gdb.base/readline.exp (operate_and_get_next): Save and restore
the TERM environment variable.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/readline.exp
gdb/testsuite/lib/gdb.exp

index b86d6257def5d6d39b3185156eecc512bff3edd3..951ad77e99fae6af52122857fb52573071ae51c9 100644 (file)
@@ -1,3 +1,10 @@
+2018-12-28  Tom Tromey  <tom@tromey.com>
+
+       * lib/gdb.exp (gdb_init): Set the TERM environment variable to
+       "dumb".
+       * gdb.base/readline.exp (operate_and_get_next): Save and restore
+       the TERM environment variable.
+
 2018-12-27  Tom Tromey  <tom@tromey.com>
 
        * gdb.python/py-cmd.exp (test_python_inline_or_multiline): Add
index 49bd308197e3f38f01a6a3e663c2cca9265d3c7e..9f0955c112ca6ef8aecf293f8fc3acc726b0096d 100644 (file)
@@ -141,57 +141,61 @@ proc operate_and_get_next {name args} {
   return 1
 }
 
+save_vars { env(TERM) } {
+    # The arrow key test relies on the standard VT100 bindings, so
+    # make sure that an appropriate terminal is selected.  The same
+    # bug doesn't show up if we use ^P / ^N instead.
+    setenv TERM vt100
 
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
+    gdb_start
+    gdb_reinitialize_dir $srcdir/$subdir
 
-if { ![readline_is_used] } {
-    unsupported "readline isn't used."
-    return -1
-}
+    if { ![readline_is_used] } {
+       unsupported "readline isn't used."
+       return -1
+    }
 
-save_vars { timeout env(GDBHISTSIZE) env(GDBHISTFILE) } {
-    set timeout 30
-
-    # A simple test of operate-and-get-next.
-    operate_and_get_next "Simple operate-and-get-next" \
-      "p 1" ".* = 1" \
-      "p 2" ".* = 2" \
-      "p 3" ".* = 3"
-
-    # Test operate-and-get-next with a secondary prompt.
-    operate_and_get_next "operate-and-get-next with secondary prompt" \
-      "if 1 > 0" "" \
-      "p 5" "" \
-      "end" ".* = 5"
-
-    # Verify that arrow keys work in secondary prompts.  The control
-    # sequence is a hard-coded VT100 up arrow.
-    gdb_test "print 42" "\\\$\[0-9\]* = 42"
-    set msg "arrow keys with secondary prompt"
-    gdb_test_multiple "if 1 > 0\n\033\[A\033\[A\nend" $msg {
-       -re ".*\\\$\[0-9\]* = 42\r\n$gdb_prompt $" {
-           pass $msg
-       }
-       -re ".*Undefined command:.*$gdb_prompt $" {
-           fail $msg
+    save_vars { timeout env(GDBHISTSIZE) env(GDBHISTFILE) } {
+       set timeout 30
+
+       # A simple test of operate-and-get-next.
+       operate_and_get_next "Simple operate-and-get-next" \
+           "p 1" ".* = 1" \
+           "p 2" ".* = 2" \
+           "p 3" ".* = 3"
+
+       # Test operate-and-get-next with a secondary prompt.
+       operate_and_get_next "operate-and-get-next with secondary prompt" \
+           "if 1 > 0" "" \
+           "p 5" "" \
+           "end" ".* = 5"
+
+       # Verify that arrow keys work in secondary prompts.  The control
+       # sequence is a hard-coded VT100 up arrow.
+       gdb_test "print 42" "\\\$\[0-9\]* = 42"
+       set msg "arrow keys with secondary prompt"
+       gdb_test_multiple "if 1 > 0\n\033\[A\033\[A\nend" $msg {
+           -re ".*\\\$\[0-9\]* = 42\r\n$gdb_prompt $" {
+               pass $msg
+           }
+           -re ".*Undefined command:.*$gdb_prompt $" {
+               fail $msg
+           }
        }
-    }
 
-    # Now repeat the first test with a history file that fills the entire
-    # history list.
+       # Now repeat the first test with a history file that fills the entire
+       # history list.
 
-    set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
-    set env(GDBHISTSIZE) "10"
+       set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"
+       set env(GDBHISTSIZE) "10"
 
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
+       gdb_exit
+       gdb_start
+       gdb_reinitialize_dir $srcdir/$subdir
 
-    operate_and_get_next "Simple operate-and-get-next" \
-      "p 7" ".* = 7" \
-      "p 8" ".* = 8" \
-      "p 9" ".* = 9"
+       operate_and_get_next "Simple operate-and-get-next" \
+           "p 7" ".* = 7" \
+           "p 8" ".* = 8" \
+           "p 9" ".* = 9"
+    }
 }
-
-return 0
index c5fda7477e063a9cf073d25d4466c5d024a17094..9cd8503f7ae68abbcb3bf2fa2ec240cb27ccbc11 100644 (file)
@@ -4732,10 +4732,9 @@ proc gdb_init { test_file_name } {
     # read from this file.
     setenv INPUTRC "/dev/null"
 
-    # The gdb.base/readline.exp arrow key test relies on the standard VT100
-    # bindings, so make sure that an appropriate terminal is selected.
-    # The same bug doesn't show up if we use ^P / ^N instead.
-    setenv TERM "vt100"
+    # This disables style output, which would interfere with many
+    # tests.
+    setenv TERM "dumb"
 
     # Some tests (for example gdb.base/maint.exp) shell out from gdb to use
     # grep.  Clear GREP_OPTIONS to make the behavior predictable,