From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16361 invoked by alias); 20 May 2010 15:50:24 -0000 Received: (qmail 16339 invoked by uid 22791); 20 May 2010 15:50:20 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 May 2010 15:50:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A297F2BAB5C; Thu, 20 May 2010 11:50:12 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KVUQn1tDOyRi; Thu, 20 May 2010 11:50:12 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 47E0F2BAADF; Thu, 20 May 2010 11:50:12 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 8037BF58FA; Thu, 20 May 2010 08:50:10 -0700 (PDT) Date: Thu, 20 May 2010 16:13:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: "gdb-patches@sourceware.org" Subject: Re: [rfa] gdb.base/volatile.exp / varargs.exp: replace send_gdb with gdb_test Message-ID: <20100520155010.GA3019@adacore.com> References: <4BF4497E.9040209@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BF4497E.9040209@vmware.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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-05/txt/msg00418.txt.bz2 For the record, Michael and I were discussing privately by email, and one of the things I wrote was that he should feel free to commit if he feels confident about his patches. Since this can be relatively mechanical, this should be relatively safe, and we can deal with adjustments using followup patches... > 2010-05-19 Michael Snyder > > * gdb.base/varargs.exp: Replace send_gdb with gdb_test. > * gdb.base/volatile.exp: Replace send_gdb with gdb_test. Some questions/suggestions... > -send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $" > -send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $" > -send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $" > +gdb_test "set print sevenbit-strings" "" \ > + "set print sevenbit-strings; ${testfile}" > +gdb_test "set print address off" "" \ > + "set print address off; ${testfile}" > +gdb_test "set width 0" "" \ > + "set width 0; ${testfile}" Just wondering why you added the "testfile" at the end of the test description? It does not seem to serve any purpose, and so yo should be able to simplify the above using: > +gdb_test "set print sevenbit-strings" "" > +gdb_test "set print address off" "" > +gdb_test "set width 0" "" You actually don't need to specify the second argument if it's empty, but I think it's good practice to do so, just to show that we do indeed expect the command to produce no output. The fact that we cannot currently verify that is a bit unfortunate, but at least the above expresses it at the testsuite level... > +gdb_test "print find_max1(5,1,2,3,4,5)" \ > + "find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5" \ > + "print find_max1(5,1,2,3,4,5)" If the test description simply repeats the command sent to GDB, then it's not necessary to provide the third argument. gdb_test does it automatically for you. Thus... > +gdb_test "print find_max1(5,1,2,3,4,5)" \ > + "find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5" ... should give you the same result. Generally speaking, my approach is becoming to use the command as the description as long as it's not ambiguous for the testcase - meaning that I don't use the same command twice in the same testcase. There might be times where I'd want a specific description, but that should be relatively rare... -- Joel