From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27709 invoked by alias); 12 Feb 2007 09:30:38 -0000 Received: (qmail 27701 invoked by uid 22791); 12 Feb 2007 09:30:37 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 12 Feb 2007 09:30:31 +0000 Received: from kahikatea.snap.net.nz (121.61.255.123.dynamic.snap.net.nz [123.255.61.121]) by viper.snap.net.nz (Postfix) with ESMTP id E43FC3D9C9E; Mon, 12 Feb 2007 22:29:59 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 49FC24F703; Mon, 12 Feb 2007 22:29:58 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17872.13205.858594.311278@kahikatea.snap.net.nz> Date: Mon, 12 Feb 2007 09:30:00 -0000 To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: -var-create testsuite updates In-Reply-To: References: <20070209162019.GA14230@nevyn.them.org> <17871.36317.301688.678052@kahikatea.snap.net.nz> X-Mailer: VM 7.19 under Emacs 22.0.93.10 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: 2007-02/txt/msg00166.txt.bz2 > > Some tests are explicitly testing -var-create e.g mi-var-cmd.exp, others > > might not be but still provide a handy check on the output e.g > > > > *** gdb.mi/mi-var-child.exp > > > > # Test: c_variable-4.2 > > # Desc: create variable "struct_declarations" > > mi_gdb_test "-var-create struct_declarations * struct_declarations" \ > > "\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct > > _struct_decl\"" \ > > "create local variable struct_declarations" > > > > I don't really like mi_create_varobj as it removes checks on type, number > > of > > children etc. > > This is intentional. Unless you're testing -var-create itself, you don't > need to check every single output field from -var-create, because: > > 1. Tests for -var-create itself should test everything already, > you don't get anything by extra tests. Looking at a test in isolation, its not immediately clear whether it's a test for -var-create itself, or not. For example, what about the one above in mi-var-child.exp. > 2. Checking output of -var-create everywhere means any > change in that output requires to update expected output, > which is pointless. It's tedious but not pointless. Testing more cases, providing it doesn't add to the run time, can only be helpful. Also the output of any change in output should be tested too. > I think there should be "mi_var_create_varobj_test" that tests entire output. > Tests for -var-create itself should use that. > > > How about if I revert all my changes which use > > mi_create_varobj and just add value=\".*\" to the regexp in each > > mi_gdb_test for -var-create? > > Why introducing new "mi_var_create_varobj_test" won't work? gdb testsuite > has too much of literal expected output as it is. The example above needs a specific number (11) for numchild. Are you proposing to add an argument for each field value? In which case it might be as easy to use mi_gdb_test. I prefer to keep the tests simple so that I can remember how they work. I generally just use cut and paste anyway. -- Nick http://www.inet.net.nz/~nickrob