From patchwork Tue Apr 7 08:08:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 6034 Received: (qmail 75388 invoked by alias); 7 Apr 2015 08:09:12 -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 75350 invoked by uid 89); 7 Apr 2015 08:09:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-wi0-f177.google.com Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 07 Apr 2015 08:09:11 +0000 Received: by wiun10 with SMTP id n10so8442196wiu.1 for ; Tue, 07 Apr 2015 01:09:08 -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:in-reply-to:references; bh=UkjNJabLLfn1blELJkegDwP6iH9vKN5f3C0x2fcHVfM=; b=NcAU/n0TtvPbaTsvFTQJfUeOfhNG7b4sEcU/aYD+pcj3yohFM95TKCkxV8oYtQxrXt dEVnezKdnLczPZapTj50sI1pZBWZhI7Khr331dyyQOitUQZyLNYVfJtRTktM4jqOe9Ni JhyoBvqJo0WGY4QrPLdCjY7KmdeGxHhpDoKSTvuAPJu6Mmk4VrwSbmO7veKhFinb3bz+ 3GSMlcVELnktuDir6X6Gu6nOLmZT5cgf/CqSb7U0HAgX7qoJtYg/Q4/fLu+Va+JOAUAu EMOAfQ3WVmUv30bWUGH4OInu88ENIpgd7M2EKOdcBE2WCeNEnTOPQPrSMO33ExK2mRZZ MRDw== X-Gm-Message-State: ALoCoQkZd+LsSgOkUF+gTVLI+09dhONIrnwr0190qM340WIg5962i3P8isSPbV9ThLsMn/0Dfk92 X-Received: by 10.194.120.230 with SMTP id lf6mr36911890wjb.78.1428394147838; Tue, 07 Apr 2015 01:09:07 -0700 (PDT) Received: from localhost ([85.133.27.37]) by mx.google.com with ESMTPSA id w3sm9870534wiz.5.2015.04.07.01.09.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 01:09:07 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 1/2] gdb/testsuite: New skip_tui_tests predicate. Date: Tue, 7 Apr 2015 09:08:54 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes Add a new predicate procedure to the gdb.exp library 'skip_tui_tests', which returns true if the tui is not compiled into gdb. I've made use of this predicate in the gdb.base/tui-layout.exp test as an example. gdb/testsuite/ChangeLog: * lib/gdb.exp (skip_tui_tests): New proc. * gdb.base/tui-layout.exp: Check skip_tui_tests. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/tui-layout.exp | 7 +++++++ gdb/testsuite/lib/gdb.exp | 15 +++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e501b11..6abb62f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-27 Andrew Burgess + + * lib/gdb.exp (skip_tui_tests): New proc. + * gdb.base/tui-layout.exp: Check skip_tui_tests. + 2015-03-25 Markus Metzger * gdb.btrace/next.exp: Merged into step.exp. diff --git a/gdb/testsuite/gdb.base/tui-layout.exp b/gdb/testsuite/gdb.base/tui-layout.exp index 0dcf1ca..cac2bc9 100644 --- a/gdb/testsuite/gdb.base/tui-layout.exp +++ b/gdb/testsuite/gdb.base/tui-layout.exp @@ -19,4 +19,11 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile] } { return -1 } +if {[skip_tui_tests]} { + # TUI support is disabled. Check for error message. + gdb_test "layout asm" "Undefined command: \"layout\". Try \"help\"." + return +} + +# Just check the command does not cause gdb to crash. gdb_test "layout asm" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f274b64..5a59a48 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1688,6 +1688,21 @@ proc skip_shlib_tests {} { return 1 } +# Return 1 if we should skip tui related tests. + +proc skip_tui_tests {} { + global gdb_prompt + + gdb_test_multiple "help layout" "verify tui support" { + -re "Undefined command: \"layout\".*$gdb_prompt $" { + return 1 + } + -re "$gdb_prompt $" {} + } + + return 0 +} + # Test files shall make sure all the test result lines in gdb.sum are # unique in a test run, so that comparing the gdb.sum files of two # test runs gives correct results. Test files that exercise