From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28712 invoked by alias); 5 May 2011 18:12:23 -0000 Received: (qmail 28627 invoked by uid 22791); 5 May 2011 18:12:22 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 18:12:08 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p45IC87N001486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 5 May 2011 14:12:08 -0400 Received: from dhcp-25-89.brq.redhat.com (pdp-11.brq.redhat.com [10.34.24.63]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p45IC7vI010371 for ; Thu, 5 May 2011 14:12:08 -0400 Message-ID: <4DC2E877.6080808@redhat.com> Date: Thu, 05 May 2011 18:12:00 -0000 From: Marek Polacek User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100827 Red Hat Thunderbird/3.1.3 MIME-Version: 1.0 To: "gdb-patches@sourceware.org" Subject: Re: [RFC] gdb.cp/static-print-quit.exp: fix racy tests (PR testsuite/12649) References: <4DC2E674.1060608@redhat.com> In-Reply-To: <4DC2E674.1060608@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: 2011-05/txt/msg00152.txt.bz2 I should have add a diff as well, here it is: diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp index b6e34aa..4bede4e 100644 --- a/gdb/testsuite/gdb.cp/static-print-quit.exp +++ b/gdb/testsuite/gdb.cp/static-print-quit.exp @@ -31,13 +31,27 @@ gdb_test_no_output "set width 80" gdb_test_no_output "set height 2" set test "print c" +set seen_return 0 gdb_test_multiple $test $test { - -re " = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type to continue, or q to quit---$" { - pass $test + "" { + incr seen_return + exp_continue + } + -re "\\$\[0-9\]+ = \{loooooooooooooooooooooooooooooooooooooooooooooong = 0, static field = \{\r\n---Type " { + incr seen_return + exp_continue + } + -re " to continue, or q " { + incr seen_return + exp_continue } -re " to quit---$" { - fail $test - return -1 + if { $seen_return >= 2 } { + pass $test + } else { + fail $test + return -1 + } } }