From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27197 invoked by alias); 28 Nov 2018 00:14:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27066 invoked by uid 89); 28 Nov 2018 00:14:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=keys, fills, U*tom, HX-HELO:sk:gateway X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.146.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Nov 2018 00:14:40 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway33.websitewelcome.com (Postfix) with ESMTP id B9D431AC865 for ; Tue, 27 Nov 2018 18:14:38 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id RnV0g8QlBSjJARnV0gVvJz; Tue, 27 Nov 2018 18:14:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nGlX+0vRiIeG80gVpS9HmmAw5lMSqE5A3V9fyOowbZc=; b=novPL3Wp49k0NN6J3g+FfO/zOk 2kWJRr5lmpIo9TpFjPaMjE0Zqo6o/MJUIJgxBf8YvWXeJTTKIyvSjhMQF51rB4GtxHwiBUTCe8rbH Qx7peNITpBnNNhu+hIf2QpGCq; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:33804 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gRnV0-004MMp-FQ; Tue, 27 Nov 2018 18:14:38 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 04/16] Change gdb test suite's TERM setting Date: Wed, 28 Nov 2018 00:16:00 -0000 Message-Id: <20181128001435.12703-5-tom@tromey.com> In-Reply-To: <20181128001435.12703-1-tom@tromey.com> References: <20181128001435.12703-1-tom@tromey.com> X-SW-Source: 2018-11/txt/msg00506.txt.bz2 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 * 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