From patchwork Tue May 12 13:07:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 6669 Received: (qmail 93402 invoked by alias); 12 May 2015 13:07:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 93380 invoked by uid 89); 12 May 2015 13:07:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-qg0-f53.google.com Received: from mail-qg0-f53.google.com (HELO mail-qg0-f53.google.com) (209.85.192.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 12 May 2015 13:07:37 +0000 Received: by qgeb100 with SMTP id b100so3302637qge.3 for ; Tue, 12 May 2015 06:07:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f1lY4bG/809Gi1jM5OPWWYxezW5jN4qwJ1s/pbk6HPY=; b=YWDWEFBrDf4L0mxe6Cmu9t1JXMWQZUnNm8KrMyJmYvrCvHgq14kq96WaRxuA56PKsC 82Y7qU/o7T6O3ysmxYv8ZK598U5wVihY/t9J6PseEJXJSUCritq7CjYItl44eAz953Lr nJkAtuVeR70/P0K//VZb90wluuBAtNkM+BgHFY5kQPGfH0+qDGj/uPe8aPKh9MC6G+TK 1uMLNETCYO5pcTa9xzSCoYDRLLfNuyJjUpo7goNi0bzEk/LRR6x3xTHr3SOT5cz5cVUH 2mYdyq8rb8FCgaNs6touJiJmXtG/P0Ot93ZCghesxnEePNK7/zgQL9iJtI9dhNDaA33y ju7A== X-Gm-Message-State: ALoCoQlTriz/CouG234zUTrpgQc3vciQnZrPoLLBvUOm/0bAm+ZLh268pWAegJh8Z/tt+HjKctnh X-Received: by 10.140.88.242 with SMTP id t105mr19298561qgd.92.1431436055553; Tue, 12 May 2015 06:07:35 -0700 (PDT) Received: from localhost.localdomain (ool-4353acd8.dyn.optonline.net. [67.83.172.216]) by mx.google.com with ESMTPSA id j90sm13301058qgd.25.2015.05.12.06.07.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 May 2015 06:07:34 -0700 (PDT) From: Patrick Palka To: gdb-patches@sourceware.org Cc: Patrick Palka Subject: [PATCH] Test the setting of "history size" via $HOME/.gdbinit Date: Tue, 12 May 2015 09:07:15 -0400 Message-Id: <1431436035-27928-1-git-send-email-patrick@parcs.ath.cx> In-Reply-To: <5551E842.3060706@redhat.com> References: <5551E842.3060706@redhat.com> Hi Pedro, How does this look? (When it is OK, I will squash this commit with the main commit before pushing it.) gdb/testsuite/ChangeLog: PR gdb/17820 * gdb.base/gdbinit-history.exp: New test. * gdb.base/gdbinit-history/unlimited/.gdbinit: New file. * gdb.base/gdbinit-history/zero/.gdbinit: New file. --- gdb/testsuite/gdb.base/gdbinit-history.exp | 41 ++++++++++++++++++++++ .../gdb.base/gdbinit-history/unlimited/.gdbinit | 1 + .../gdb.base/gdbinit-history/zero/.gdbinit | 1 + 3 files changed, 43 insertions(+) create mode 100644 gdb/testsuite/gdb.base/gdbinit-history.exp create mode 100644 gdb/testsuite/gdb.base/gdbinit-history/unlimited/.gdbinit create mode 100644 gdb/testsuite/gdb.base/gdbinit-history/zero/.gdbinit diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp new file mode 100644 index 0000000..194f2df --- /dev/null +++ b/gdb/testsuite/gdb.base/gdbinit-history.exp @@ -0,0 +1,41 @@ +# Copyright 2015 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This file is part of the gdb testsuite. + +# Test the setting of "history size" via $HOME/.gdbinit + +proc test_gdbinit_history_setting { home size } { + global env + global INTERNAL_GDBFLAGS + global srcdir + global subdir + + set old_home $env(HOME) + set env(HOME) "$srcdir/$subdir/$home" + set saved_internal_gdbflags $INTERNAL_GDBFLAGS + set INTERNAL_GDBFLAGS [string map {"-nx" ""} $INTERNAL_GDBFLAGS] + + gdb_exit + gdb_start + + gdb_test "show history size" "The size of the command history is $size." + + set INTERNAL_GDBFLAGS $saved_internal_gdbflags + set $env(HOME) $old_home +} + +test_gdbinit_history_setting "gdbinit-history/unlimited" "unlimited" +test_gdbinit_history_setting "gdbinit-history/zero" "0" diff --git a/gdb/testsuite/gdb.base/gdbinit-history/unlimited/.gdbinit b/gdb/testsuite/gdb.base/gdbinit-history/unlimited/.gdbinit new file mode 100644 index 0000000..6604d8f --- /dev/null +++ b/gdb/testsuite/gdb.base/gdbinit-history/unlimited/.gdbinit @@ -0,0 +1 @@ +set history size unlimited diff --git a/gdb/testsuite/gdb.base/gdbinit-history/zero/.gdbinit b/gdb/testsuite/gdb.base/gdbinit-history/zero/.gdbinit new file mode 100644 index 0000000..7cd6b24 --- /dev/null +++ b/gdb/testsuite/gdb.base/gdbinit-history/zero/.gdbinit @@ -0,0 +1 @@ +set history size 0