From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#74786: [PATCH] Add custom args to test compile step Date: Wed, 11 Dec 2024 16:58:03 +0100 Message-ID: <87wmg643g4.fsf@gmail.com> References: <86wmg62pfs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33246"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Randy Taylor , "O'Brien, Will" , 74786@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 11 17:00:59 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tLP91-0008SC-1y for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 17:00:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLP8V-00077r-C7; Wed, 11 Dec 2024 11:00:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLP8C-0006zV-8f for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 11:00:12 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLP89-0004eK-Ud for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 11:00:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=wD+d0yfmnQSmXXbDVeXSogigChB72LUROeK3xg0bKvY=; b=szPHhqGRQcyfjEcsIGbTLlajegUzpN7t03iumnlbNDuMopkBoLzXm/ZpYGsvhMx1nnbeAgBEPfBOcZqH0PD7D/yvgHQ4cbwksdgS2AEdiC1gLCtrvudZajyaGXlbQdJunK2PYiena+WtfslVe35eqxbTo480MIyY/szMXV0gH99nd23plDgo4n6TA+21tpGkrbrmSCXJeS6beoNJ6A/kvyg2qBwBgFiMKDDW2camKmqir5bUjA7i1sZMAaZ+0kRyPbJKuTorPMyYgjmUC9l1bs1Eg9kEa3b5NCX8nLgm37wK/dfhP5Xc+xosd6vtGbNAD3NOTihKPG7CKGl+yLNNWw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLP89-0000iQ-MC for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 11:00:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2024 16:00:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74786-submit@debbugs.gnu.org id=B74786.17339327542522 (code B ref 74786); Wed, 11 Dec 2024 16:00:05 +0000 Original-Received: (at 74786) by debbugs.gnu.org; 11 Dec 2024 15:59:14 +0000 Original-Received: from localhost ([127.0.0.1]:35822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLP7K-0000eX-03 for submit@debbugs.gnu.org; Wed, 11 Dec 2024 10:59:14 -0500 Original-Received: from mail-wr1-f53.google.com ([209.85.221.53]:49400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLP7H-0000e1-5X for 74786@debbugs.gnu.org; Wed, 11 Dec 2024 10:59:12 -0500 Original-Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-385e06af753so3056286f8f.2 for <74786@debbugs.gnu.org>; Wed, 11 Dec 2024 07:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733932685; x=1734537485; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wD+d0yfmnQSmXXbDVeXSogigChB72LUROeK3xg0bKvY=; b=gjnEOttYYy+07aYYxLbF30u94NdkbtrgIjy+SUl33oGg6nl22/SExbrHJ6u38gvopC jAHYM8xCyCP1pfjQidc1bphv9RIVc6uuvVbCsmxgui3/S2NC0a4rkUkpHeDbiJGAhjLd qxgf1qUMnB0PcWXivzde18GSLan1kIzKhmG0lVF+OJvnHtYF1nphuKgw0YbgC+BxVf5s 4oLFrMbxkZAAvZkOBjdSRwYaXz3sdF5xwidVIKkyrLP+tBZgx2LB4f/uv+mp+ZqfWOOm XnLW/4HbXMu1hISPGF73xErEie2ES6FMELCqa0H1saudy/Xd7eF0i4/rpWzdKKZ3V2lv RNyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733932685; x=1734537485; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wD+d0yfmnQSmXXbDVeXSogigChB72LUROeK3xg0bKvY=; b=iHKtGqBbOIlyWbcPazwYJeTKvfLfuXSeow6GIi+IGRFJka2mTrcGv3es6w1rolPiyT Tv8mqOk7d4NO9JZRxrO90FqI6CDth8mu0u3gVIFiQ6mu4Ezbv+mLExfesSZadnkst8Mc lZDZS2AGUOHEql9cjQ71Iegi1tdWhS10JSeEEOifANWgWnHQ7FdnnfhCUengAnLOFZ0c fIVTvqIWDvsns2rYacUFRcHxq4PobwfdsfyYaL4SrAnl5JI3PvKPrvQugJ9MUunpfh9t Yd7mdM6icupiLQjmkwKcond/e7AWoOOyPqofM0FDpqGq0ikZAI0TLUyu76SeyzxRKfPM 6QQw== X-Forwarded-Encrypted: i=1; AJvYcCUK7t/ubObcrd8N81RmKWwOE4YEaPcT9gP+VyKEk4YqPwpRA0LMCbbK2ap3zTy6sjiLVHBrzA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwNOOd0jZ5wO42YUWDJv5MLsbf6/mMKltoquObO+Eo+qjgJdzPY roYBSoj0AAwXE7dGs472DK4ma61IyUsGYgfN9Pqbfsf5Z5UL2b3/wi2AKA== X-Gm-Gg: ASbGncsjJCh4cHkwJiXlVoaOwXaHOBtIH1rJ92YAt9KxcI/wvAEAOwUe4AVRDGj4Bgn 0n/HWWqvCx6O+Fyq125cvxEp3AXrPxrm7ujcdm/EchdPwAvkcIC8J/N1Bu1SiE0pugeilC1sgT9 O1TekazY1e9LWAaAwCcxYiw0MuTcTHjTSIaQ1oXnbVu7YLUw8m69zFKN9NIP8kUsQSmSMLBCcrV GTO3hqCnoqmdUe5/VFSPQQb05mBTQgesM5cq79bwA== X-Google-Smtp-Source: AGHT+IE98unUP6320w/CY7lSh511XxjBMe5/Uv6sB0/Q0+1aKE0h7bS6tFyRLalLyLvoAV9yhJ7qUQ== X-Received: by 2002:a5d:6486:0:b0:385:f249:c336 with SMTP id ffacd0b85a97d-3864cec57c2mr3344191f8f.45.1733932684516; Wed, 11 Dec 2024 07:58:04 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb51:c52c:e130:63af:d25d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38782514bf9sm1598483f8f.80.2024.12.11.07.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 07:58:04 -0800 (PST) In-Reply-To: <86wmg62pfs.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Dec 2024 17:45:59 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296844 Archived-At: >>>>> On Wed, 11 Dec 2024 17:45:59 +0200, Eli Zaretskii said: >> From: "O'Brien, Will" >> Date: Wed, 11 Dec 2024 10:18:04 +0000 >>=20 >> First time trying to contribute here, so apologies for any wrong doi= ng. I >> haven't signed FSF papers; would be happy to but believe this may fi= t in to >> tiny patch territory. Eli> It does. But you may wish to start the paperwork regardless, so we Eli> could accept your future contributions without limitations. Let me Eli> know if you want me to send you the form and instructions. >> This is a feature request to pass custom flags down to the test comp= ile >> step in go-ts-mode-test-... functions. Specifically I wanted to >> add the coverprofile argument to unit test invocation. >>=20 >> The attached patch seems to do the trick for me. Eli> Thanks. Eli> Randy, any comments or suggestions? I=CA=BCm not Randy, but: >> +(defun go-ts-mode--get-test-args () >> + "Return the test args. >> +This function respects the `go-ts-mode-test-args' variable for >> +specifying test args, such as adding coverage file." >> + (if go-ts-mode-test-args >> + (string-join go-ts-mode-test-args) >> + "")) >> + This entire function is not needed, since (string-join nil) =3D> "" >> (defun go-ts-mode--compile-test (regexp) >> "Compile the tests matching REGEXP. >> This function respects the `go-ts-mode-build-tags' variable for >> specifying build tags." >> - (compile (format "go test -v %s -run '%s'" >> + (compile (format "go test %s -v %s -run '%s'" >> + (go-ts-mode--get-test-args) >> (go-ts-mode--get-build-tags-flag) >> regexp))) >>=20 so you could just inline the `string-join' here. Robert --=20