From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by sourceware.org (Postfix) with ESMTPS id 47005385DC14 for ; Mon, 27 Apr 2020 19:06:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 47005385DC14 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x444.google.com with SMTP id d17so21857891wrg.11 for ; Mon, 27 Apr 2020 12:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XHkSwMYiBVHIc9NkEsB81Ul43yfEAcH4hWAkCTOlfOo=; b=c6MJXDKdLB3ZfDugBb3+WR7DavLXRvs3wyoYaJTCVvnKJKo2Sh30zGysgC3BcnsM/Y T09T3ZIxJjhLO9Z830AAwrHiRPI0owuKzhZs9cF8/ztnUay91ZbK5ymIDlHOYYUPUTtD O4JX51IJEwnw142GRc6cWOSx3GaCq/DS4kVYqdvE6kNv6kFflnA3laaV/2CtYe7lBcRV 6lBjbgIhgcbDj3DW+1A3c0BFjYnak+3BzBRvLegbK01IZQ1TeLCsZ26OcbDA9NujSz02 jtViy6xr/YxBWIt+OWgr0MdayFttj326TuawIOQyKtcAKNMxb+z1Cvl5Twu4K8kpnJdm UX2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XHkSwMYiBVHIc9NkEsB81Ul43yfEAcH4hWAkCTOlfOo=; b=HeAjSxKI74O9ZJMU0y1sbHj2lEUZGxJcaOD48ioTw9jgTAXa1JtilB5spwlCQATNAX QJ+5ArC7RbYwBw57Wp3jcSgCDmibyqLzdK2eMFdWKPPGpxbiPTS9vwakOJHXuNfP2VLA RPy8c5P73hOu/YBwTp0Ja1EN56bK6J7ys9Mp/IC1o0w33bngL6KX8SMdDpHd/2fB3dbW 7zZY5vWwoGxPbV9lJsEiy3VW/Y4P2u25iibZ4KY+GhBep7Jsq0uEa1vLWGTB6tCtniN5 1H5lrwaG16fWvt21xF+m5AVI1za9aiga+nZRoM5F6QjcV+N1sknfE1OBRAxsZX+sFxIp DN7Q== X-Gm-Message-State: AGi0PuaUkn2WwmuQj1T3/U4YrnPSoYQWLmF0ZF5P/vj0hN6OCwetvU7V 6Dz3dtNgfEPT0/o9sPs+fuBVeQ== X-Google-Smtp-Source: APiQypKLPBrQx1TFg17dqdWyvGSBG507KRMKnCyCY9Z+21kfnh+m/yqZxrOzmMmC5mndVi6yUPmZpA== X-Received: by 2002:a5d:420a:: with SMTP id n10mr27698777wrq.235.1588014365360; Mon, 27 Apr 2020 12:06:05 -0700 (PDT) Received: from localhost (host81-151-181-184.range81-151.btcentralplus.com. [81.151.181.184]) by smtp.gmail.com with ESMTPSA id o3sm22490750wru.68.2020.04.27.12.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 12:06:04 -0700 (PDT) Date: Mon, 27 Apr 2020 20:06:03 +0100 From: Andrew Burgess To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/4] gdb/testsuite: Detect and warn if paths are used in test names Message-ID: <20200427190603.GH3522@embecosm.com> References: <20200427155858.GG3522@embecosm.com> <856efd0a-243d-e366-eb48-85fc65349706@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <856efd0a-243d-e366-eb48-85fc65349706@redhat.com> X-Operating-System: Linux/5.5.17-200.fc31.x86_64 (x86_64) X-Uptime: 20:04:05 up 7 days, 3:52, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2020 19:06:16 -0000 * Keith Seitz [2020-04-27 09:42:30 -0700]: > On 4/27/20 8:58 AM, Andrew Burgess wrote: > > * Keith Seitz [2020-04-23 13:26:30 -0700]: > >>> +set local_record_procs(pass) "check_test_names" > >>> +set local_record_procs(fail) "check_test_names" > >>> +set local_record_procs(xfail) "check_test_names" > >>> +set local_record_procs(kfail) "check_test_names" > >>> +set local_record_procs(xpass) "check_test_names" > >>> +set local_record_procs(kpass) "check_test_names" > >>> +set local_record_procs(unresolved) "check_test_names" > >>> +set local_record_procs(untested) "check_test_names" > >>> +set local_record_procs(unsupported) "check_test_names" > >> > >> Since I failed to contain the Tcl pedantic in me, the above > >> can be more Tcl-ishly written with `array set', but I am not > >> requesting that you change anything. Just FYI. > > > > Thanks for your feedback, I'm making a few changes to the patch, but I > > wanted to follow up on the 'array set' issue, I'd like to get things > > right where I can, however, in this case.... > > > > $ tclsh > > % array set foo {} > > % array set foo(bar) 1 > > list must have an even number of elements > > > > This is inline with what I see when I try to use 'array set ....' > > within the Dejagnu script, I get the error 'list must have an even > > number of elements'. > > > > Is there something I'm doing wrong here? Or is 'array set' not > > actually needed in this case? > > To be clear -- I apologize if I wasn't earlier -- you do not /need/ > to use array set. As I mentioned, the more Tcl-ish way to write large > array initializations is > > array set local_record_procs { > pass check_test_names > fail check_test_names > # ... > } > > "array set" takes a list of key-value pairs, so there must be > an even number of elements in the list. > > However, in hindsight, since all these are being set to the same > value, an even more Tcl-ish way: > > foreach nm {pass fail xfail kfail xpass kpass unresolved untested unsupported} { > set local_record_procs($nm) check_test_names > } > > [While tempting to use "[array names local_record_procs]", reading framework.exp > shows that this array is not actually expected to exist, so we have to > explicitly list out all test result outcomes.] > > Okay, that was probably way more hassle than necessary... I promise to > backburner my [counterproductive] Tcl pedantic-ness[sic]! No, it's not a problem. Dejagnu / TCL isn't likely to go anywhere anytime soon, so it's always good to learn more. I'll incorporate your suggested foreach loop improvement. Thanks, Andrew