Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 04/16] Change gdb test suite's TERM setting
Date: Wed, 28 Nov 2018 00:16:00 -0000	[thread overview]
Message-ID: <20181128001435.12703-5-tom@tromey.com> (raw)
In-Reply-To: <20181128001435.12703-1-tom@tromey.com>

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-11-27  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             |  7 +++
 gdb/testsuite/gdb.base/readline.exp | 94 +++++++++++++++--------------
 gdb/testsuite/lib/gdb.exp           |  7 +--
 3 files changed, 59 insertions(+), 49 deletions(-)

diff --git a/gdb/testsuite/gdb.base/readline.exp b/gdb/testsuite/gdb.base/readline.exp
index 49bd308197..9f0955c112 100644
--- a/gdb/testsuite/gdb.base/readline.exp
+++ b/gdb/testsuite/gdb.base/readline.exp
@@ -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
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5a5713b114..7eed7b5190 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4719,10 +4719,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,
-- 
2.17.2


  parent reply	other threads:[~2018-11-28  0:14 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  0:16 [PATCH 00/16] Add styling to the gdb CLI and TUI Tom Tromey
2018-11-28  0:14 ` [PATCH 02/16] Add a "context" argument to add_setshow_enum_cmd Tom Tromey
2018-11-28  0:14 ` [PATCH 03/16] Introduce ui_file_style Tom Tromey
2018-12-24  3:40   ` Joel Brobecker
2018-12-28 18:54     ` Tom Tromey
2018-11-28  0:14 ` [PATCH 14/16] Use wclrtoeol in tui_show_source_line Tom Tromey
2018-12-24  8:03   ` Joel Brobecker
2018-11-28  0:14 ` [PATCH 06/16] Reset terminal styles Tom Tromey
2018-12-24  4:16   ` Joel Brobecker
2018-12-28 19:01     ` Tom Tromey
2018-11-28  0:14 ` [PATCH 10/16] Style the gdb welcome message Tom Tromey
2018-11-28  0:14 ` [PATCH 12/16] Style addresses Tom Tromey
2018-11-28  0:14 ` [PATCH 09/16] Style print_address_symbolic Tom Tromey
2018-11-28  0:14 ` [PATCH 05/16] Add output styles to gdb Tom Tromey
2018-12-24  4:08   ` Joel Brobecker
2018-12-28 18:55     ` Tom Tromey
2018-11-28  0:16 ` [PATCH 15/16] Highlight source code using GNU Source Highlight Tom Tromey
2019-11-16  0:58   ` Andrew Pinski
2019-11-16  8:19     ` Eli Zaretskii
2019-11-24 17:41     ` Tom Tromey
2019-11-24 18:13       ` Christian Biesinger via gdb-patches
2019-11-24 19:53         ` Tom Tromey
2018-11-28  0:16 ` Tom Tromey [this message]
2018-11-28  0:16 ` [PATCH 13/16] Make ANSI terminal escape sequences work in TUI Tom Tromey
2018-12-24  8:02   ` Joel Brobecker
2018-12-28 19:42   ` Tom Tromey
2018-11-28  0:16 ` [PATCH 08/16] Style locations when setting a breakpoint Tom Tromey
2018-11-28  0:16 ` [PATCH 16/16] Document the "set style" commands Tom Tromey
2018-11-28  6:51   ` Eli Zaretskii
2018-12-28 19:19     ` Tom Tromey
2018-11-28  0:16 ` [PATCH 07/16] Style variable names Tom Tromey
2018-11-28  0:16 ` [PATCH 11/16] Style the "Reading symbols" message Tom Tromey
2018-11-28  0:19 ` [PATCH 01/16] Change wrap buffering to use a std::string Tom Tromey
2018-12-23 15:26   ` Joel Brobecker
2018-12-28 18:47     ` Tom Tromey
2018-11-28  7:02 ` [PATCH 00/16] Add styling to the gdb CLI and TUI Eli Zaretskii
2018-11-29 22:44   ` Tom Tromey
2018-11-30  7:02     ` Eli Zaretskii
2018-11-30 16:17       ` Tom Tromey
2018-12-23 10:49         ` Joel Brobecker
2019-03-01 13:10         ` Pedro Alves
2019-03-01 13:56           ` Eli Zaretskii
2019-03-01 14:10             ` Pedro Alves
2019-03-01 14:50               ` Eli Zaretskii
2019-03-01  7:47     ` Eli Zaretskii
2019-03-01 18:42       ` Tom Tromey
2019-03-01 19:40         ` Eli Zaretskii
2019-03-01 21:04           ` Tom Tromey
2019-03-02  7:15             ` Eli Zaretskii
2019-03-03 15:42             ` Eli Zaretskii
2019-03-04 15:08               ` Tom Tromey
2019-03-04 15:57                 ` Eli Zaretskii
2019-03-04 16:16                   ` Tom Tromey
2019-03-05 15:38                     ` Eli Zaretskii
2019-03-08 14:55                       ` Eli Zaretskii
2019-03-08 16:14                         ` Hannes Domani via gdb-patches
2019-03-08 21:08                           ` Tom Tromey
2019-03-08 21:11                         ` Tom Tromey
2019-03-09  6:49                           ` Eli Zaretskii
2019-03-03 15:53             ` Eli Zaretskii
2019-03-03 16:16               ` Matt Rice
2019-03-03 17:13                 ` Eli Zaretskii
2019-03-03 18:04                   ` Matt Rice
2019-03-04 15:01               ` Tom Tromey
2019-03-04 17:37                 ` Eli Zaretskii
2019-03-04 17:40                   ` Tom Tromey
2019-03-06 16:02                     ` Eli Zaretskii
2019-03-20 19:35                       ` GDB version as convenience variable Eli Zaretskii
2019-03-25 17:31                         ` Eli Zaretskii
2019-03-25 17:58                           ` Simon Marchi
2019-03-25 18:10                             ` Eli Zaretskii
2019-03-25 18:33                               ` Simon Marchi
2019-03-25 18:37                                 ` Simon Marchi
2019-03-25 18:43                                 ` Eli Zaretskii
2019-03-25 18:51                                   ` Simon Marchi
2019-03-25 19:19                                     ` Eli Zaretskii
2019-03-26 14:47                                       ` Simon Marchi
2019-03-26 20:57                                         ` Joel Brobecker
2019-03-27  3:34                                           ` Eli Zaretskii
2019-03-27 12:56                                             ` Joel Brobecker
2019-03-30 17:25                                               ` Simon Marchi
2019-03-30 10:01                                         ` Eli Zaretskii
2019-03-21  1:55                       ` [PATCH 00/16] Add styling to the gdb CLI and TUI Simon Marchi
2019-03-21 14:38                         ` Eli Zaretskii
2019-03-21 15:02                           ` Simon Marchi
2019-03-21 16:01                             ` Eli Zaretskii
2019-03-21 16:06                               ` Simon Marchi
2019-03-21 16:12                                 ` Pedro Alves
2019-03-21 16:54                                   ` John Baldwin
2019-03-21 17:02                                   ` Eli Zaretskii
2019-03-21 18:08                                     ` Simon Marchi
2019-03-21 18:19                                       ` Pedro Alves
2019-03-21 18:38                                         ` Eli Zaretskii
2019-03-07  6:02                   ` Joel Brobecker
2019-03-07 14:53                     ` Eli Zaretskii
2019-03-08  5:40                       ` Joel Brobecker
2019-03-04 16:04       ` Eli Zaretskii
2018-12-24  9:27 ` Joel Brobecker
2018-12-28 20:57   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181128001435.12703-5-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox