From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7024 invoked by alias); 7 Jul 2010 18:52:08 -0000 Received: (qmail 7013 invoked by uid 22791); 7 Jul 2010 18:52:07 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jul 2010 18:52:02 +0000 Received: from hpaq11.eem.corp.google.com (hpaq11.eem.corp.google.com [172.25.149.11]) by smtp-out.google.com with ESMTP id o67IpxJF010519 for ; Wed, 7 Jul 2010 11:51:59 -0700 Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.18.118.116]) by hpaq11.eem.corp.google.com with ESMTP id o67Ipwnn017346 for ; Wed, 7 Jul 2010 11:51:59 -0700 Received: by ruffy.mtv.corp.google.com (Postfix, from userid 67641) id 07D72845AE; Wed, 7 Jul 2010 11:51:57 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [commit] fix failures in default.exp, show convenience Message-Id: <20100707185158.07D72845AE@ruffy.mtv.corp.google.com> Date: Wed, 07 Jul 2010 18:52:00 -0000 From: dje@google.com (Doug Evans) X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2010-07/txt/msg00126.txt.bz2 Hi. There are more internal convenience vars now ($_sdata, $_thread) but default.exp hasn't been updated to recognize them so it's failing. Committed. 2010-07-07 Doug Evans * lib/gdb.exp (gdb_test_list_exact): New function. * gdb.base/default.exp (show convenience): Call it, add tests for $_sdata = void, $_thread = 0. Index: gdb.base/default.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/default.exp,v retrieving revision 1.42 diff -u -p -r1.42 default.exp --- gdb.base/default.exp 10 Jun 2010 19:48:19 -0000 1.42 +++ gdb.base/default.exp 7 Jul 2010 18:46:58 -0000 @@ -567,8 +567,19 @@ gdb_test "show commands" ".*" "show comm gdb_test "show complaints" "Max number of complaints about incorrect symbols is 0." "show complaints" #test show confirm gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm" + #test show convenience -gdb_test "show convenience" "\\\$_siginfo = void" "show convenience" +# This is tricker as there are multiple internal convenience vars and we +# can't assume any particular order. +gdb_test_list_exact "show convenience" "show convenience" \ + {[^\r\n]+[\r\n]+} \ + {[^\r\n]+} \ + { \ + {$_sdata = void} \ + {$_siginfo = void} \ + {$_thread = 0} \ + } + #test show directories gdb_test "show directories" "Source directories searched: .cdir\[:;\].cwd" "show directories" #test show editing Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.152 diff -u -p -r1.152 gdb.exp --- lib/gdb.exp 28 Jun 2010 20:09:59 -0000 1.152 +++ lib/gdb.exp 7 Jul 2010 18:46:58 -0000 @@ -1036,6 +1036,59 @@ proc gdb_test_exact { args } { return [gdb_test $command $pattern $message] } + +# Wrapper around gdb_test_multiple that looks for a list of expected +# output elements, but which can appear in any order. +# CMD is the gdb command. +# NAME is the name of the test. +# ELM_FIND_REGEXP specifies how to partition the output into elements to +# compare. +# ELM_EXTRACT_REGEXP specifies the part of ELM_FIND_REGEXP to compare. +# RESULT_MATCH_LIST is a list of exact matches for each expected element. +# All elements of RESULT_MATCH_LIST must appear for the test to pass. +# +# A typical use of ELM_FIND_REGEXP/ELM_EXTRACT_REGEXP is to extract one line +# of text per element and then strip trailing \r\n's. +# Example: +# gdb_test_list_exact "foo" "bar" \ +# {[^\r\n]+[\r\n]+} \ +# {[^\r\n]+} \ +# { \ +# {expected result 1} \ +# {expected result 2} \ +# } + +proc gdb_test_list_exact { cmd name elm_find_regexp elm_extract_regexp result_match_list } { + global gdb_prompt + + set matches [lsort $result_match_list] + set seen {} + gdb_test_multiple $cmd $name { + "$cmd\[\r\n\]" { exp_continue } + -re $elm_find_regexp { + set str $expect_out(0,string) + verbose -log "seen: $str" 3 + regexp -- $elm_extract_regexp $str elm_seen + verbose -log "extracted: $elm_seen" 3 + lappend seen $elm_seen + exp_continue + } + -re "$gdb_prompt $" { + set failed "" + foreach got [lsort $seen] have $matches { + if {![string equal $got $have]} { + set failed $have + break + } + } + if {[string length $failed] != 0} { + fail "$name ($failed not found)" + } else { + pass $name + } + } + } +} proc gdb_reinitialize_dir { subdir } { global gdb_prompt