From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43462 invoked by alias); 26 Mar 2019 20:57:21 -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 43451 invoked by uid 89); 26 Mar 2019 20:57:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=Something, Apparently X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Mar 2019 20:57:19 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1EC3E116CEA; Tue, 26 Mar 2019 16:57:18 -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 ziOZfTXfUgxp; Tue, 26 Mar 2019 16:57:18 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E24E5116CE4; Tue, 26 Mar 2019 16:57:17 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 4355183AE0; Tue, 26 Mar 2019 13:57:16 -0700 (PDT) Date: Tue, 26 Mar 2019 20:57:00 -0000 From: Joel Brobecker To: Simon Marchi Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: GDB version as convenience variable Message-ID: <20190326205716.GC6837@adacore.com> References: <83imwwc7pj.fsf@gnu.org> <83k1gts5it.fsf@gnu.org> <83r2aun9mk.fsf@gnu.org> <9d445bd2-28dd-be84-5414-510e061e4db1@simark.ca> <83mulin7ui.fsf@gnu.org> <83k1gmn6b2.fsf@gnu.org> <83imw6n4ny.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2019-03/txt/msg00612.txt.bz2 > Apparently, the test default.exp needs to be changed in any case, > because it adds new convenience variables. Without modification, the > "show convenience" test fails because there is a new entry it doesn't > know about. > > So for now, I would suggest adding the modification below to your > patch to keep the test passing. It is not obvious to change the test > to match the convenience variable value against a variable or even > against a regexp, because it uses gdb_test_list_exact, which does > straight string comparison. > > Also, I am not sure if reading the output of "show version" and > testing against that would be a really good test, because the > implementation and the test would work essentially work the same way. > So if the version string erroneously becomes 0.0.0 because of some bug > in some script, the test would still pass, even though the values are > wrong. > > At least, the following is simple and robust. Hmmm, the direct string comparison thing is a bit annoying. This is going to be one more manual test to do after each branch, and I'm a bit concerned about that. We can start with that, as we want the test to pass. But I'm wondering if, instead of getting the output from "show version" to determine the expected values, we could parse gdb/version.in instead. If needed, we could so the parsing as part of the build process (ig do it in the makefile, and store the result in a couple of files). Something like that. > diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp > index ece1428e617e..9ff5144448d8 100644 > --- a/gdb/testsuite/gdb.base/default.exp > +++ b/gdb/testsuite/gdb.base/default.exp > @@ -602,6 +602,8 @@ set show_conv_list \ > {$_probe_arg10 = } \ > {$_probe_arg11 = } \ > {$_isvoid = } \ > + {$_gdb_major = 8} \ > + {$_gdb_minor = 4} \ > } > if ![skip_python_tests] { > append show_conv_list \ > > > > Simon -- Joel