From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16041 invoked by alias); 21 May 2014 07:02:16 -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 16027 invoked by uid 89); 21 May 2014 07:02:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga02.intel.com Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 May 2014 07:01:44 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 21 May 2014 00:01:41 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 21 May 2014 00:01:24 -0700 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s4L71NMI010751; Wed, 21 May 2014 08:01:23 +0100 Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id s4L71Nah004293; Wed, 21 May 2014 09:01:23 +0200 Received: (from mmetzger@localhost) by ulvlx001.iul.intel.com with œ id s4L71N1P004289; Wed, 21 May 2014 09:01:23 +0200 From: Markus Metzger To: palves@redhat.com Cc: gdb-patches@sourceware.org Subject: [PATCH v3 2/3] test, gcore: move capture_command_output into lib/gdb.exp Date: Wed, 21 May 2014 07:02:00 -0000 Message-Id: <1400655682-4014-2-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1400655682-4014-1-git-send-email-markus.t.metzger@intel.com> References: <1400655682-4014-1-git-send-email-markus.t.metzger@intel.com> X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00458.txt.bz2 Allow gcore's capture_command_output function to be used by other tests. 2014-05-21 Markus Metzger testsuite/ * gdb.base/gcore.exp (capture_command_output): Move ... * lib/gdb.exp (capture_command_output): ... here. --- gdb/testsuite/gdb.base/gcore.exp | 13 ------------- gdb/testsuite/lib/gdb.exp | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp index 99743a0..c28a9b3 100644 --- a/gdb/testsuite/gdb.base/gcore.exp +++ b/gdb/testsuite/gdb.base/gcore.exp @@ -41,19 +41,6 @@ if { ! [ runto_main ] } then { return -1 } -proc capture_command_output { command prefix } { - global gdb_prompt - global expect_out - - set output_string "" - gdb_test_multiple "$command" "capture_command_output for $command" { - -re "${command}\[\r\n\]+${prefix}(.*)\[\r\n\]+$gdb_prompt $" { - set output_string $expect_out(1,string) - } - } - return $output_string -} - gdb_test "break terminal_func" "Breakpoint .* at .*${srcfile}, line .*" \ "set breakpoint at terminal_func" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 0fe6c31..22a43b6 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4772,5 +4772,19 @@ proc parse_args { argset } { # number of items expected to be passed into the procedure... } +# Capture the output of COMMAND in a string ignoring PREFIX; return that string. +proc capture_command_output { command prefix } { + global gdb_prompt + global expect_out + + set output_string "" + gdb_test_multiple "$command" "capture_command_output for $command" { + -re "${command}\[\r\n\]+${prefix}(.*)\[\r\n\]+$gdb_prompt $" { + set output_string $expect_out(1,string) + } + } + return $output_string +} + # Always load compatibility stuff. load_lib future.exp -- 1.8.3.1