From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "O'Brien, Will" Newsgroups: gmane.emacs.bugs Subject: bug#74786: [PATCH] Add custom args to test compile step Date: Wed, 11 Dec 2024 16:31:49 +0000 Message-ID: References: <86wmg62pfs.fsf@gnu.org> <87wmg643g4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27288"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Randy Taylor , Eli Zaretskii , 74786@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 11 18:34:00 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 1tLQb0-0006vv-IB for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 18:33:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLQVM-00073U-Ia; Wed, 11 Dec 2024 12:28:08 -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 1tLQVI-0006ng-2a for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 12:28:04 -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 1tLQVH-0001Ev-Pj for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 12:28:03 -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=4ck4D527Cl+UjmKQrFSSBZKlWC6OiEXiqbkWnipoty4=; b=Ks6uwsQeui0qoA0FUj/zqTZQ9Zx9zhZTtCJ/o29aa/y9a99Y/6Tt5CzaeFimABvq/+vCGJt1T4yxr+n94UPATc7v/Qn1MSPRbt9a4f7VzD1AVUre2eZ+ADGFelIqXoKVogXjvtZ/mX8WglWWOjil7UDLBVFAm2eDt7kNBXEZySlXk/BBlKg7VrheMhjVE4Y+f5P1ZNbmcov5Qr0r0bVw8C2myNxsLVWEI/aUlEkDw8K62EW3LDW9EfmoR7FS4mfAz1C+fGOBYGMvvrJicljlUYoQqqWYI/6FToG4qEd/3pMozQoW1sHdUrZIEdrfftcUFsMLN0camd92siQMzorvNA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLQVH-0008Cc-KC for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 12:28:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "O'Brien, Will" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2024 17:28:03 +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.173393803131327 (code B ref 74786); Wed, 11 Dec 2024 17:28:03 +0000 Original-Received: (at 74786) by debbugs.gnu.org; 11 Dec 2024 17:27:11 +0000 Original-Received: from localhost ([127.0.0.1]:36123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLQUQ-000892-Ge for submit@debbugs.gnu.org; Wed, 11 Dec 2024 12:27:11 -0500 Original-Received: from mail-wm1-f42.google.com ([209.85.128.42]:55618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLPds-0003Pp-H7 for 74786@debbugs.gnu.org; Wed, 11 Dec 2024 11:32:53 -0500 Original-Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4361dc6322fso5987945e9.3 for <74786@debbugs.gnu.org>; Wed, 11 Dec 2024 08:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733934712; x=1734539512; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4ck4D527Cl+UjmKQrFSSBZKlWC6OiEXiqbkWnipoty4=; b=XGMCRIj18u6mH/HopcBi2IgrMovuSKYQIFrpxIeYhNa88BdgXTzbc/axjRkMNpAajf Ap60t2HPdKpSEKPnv5IttOoJSIYnIUUbZI/LVhbN1UHYmeh4RMLnV1TPHQxy4rqwzz4L d6TwBDt6zriYOknjAsTAXh3qZRemySRHhWR5WJh24oWIJctYhnOT2J88wf4Xp5hbdcUe +3l/hn8CESQh07gIv8ZxqcMAdxoVFmQ4YOhLTndvSzsudWMYR7J9iSN522fynZDs4StF aougWTei80vCKcQ9fv+QOls838qAi8k/MmXU27oEfECuNZ8dz79GscYZomMDVbIHA4ou +FyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733934712; x=1734539512; h=mime-version:user-agent: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=4ck4D527Cl+UjmKQrFSSBZKlWC6OiEXiqbkWnipoty4=; b=W2MgHpe7JfiGIXQHj+9jwE1nmueQI99yPnCWowfu5BMFT1+mnreV3vdWqJER6+mZ7u KnYmjK56TsafCvjyD+hSkZIvE18Slp7nbSJZOdloYc3UZhk+UWKZNdHIOjR0Ew9us8ps xDYV/EdLDXTF/YyHy8N6gAR2e3Qf94anyzxbbeE8ufI6XNEdsRVhldw2GNPRcJXfg2Kf j6S133luGJZljHGmiD9V+WJxU2VbzmtIkoXydS1fuO5tQoK9nmWVfoda7UurWWhJ0ivF wqqoN+ex9ExSr8EPxpYSB+iy/P/gMn4JHZAiimKY9kYqsyvlz63VcztZGxZ8QYJiavzF pN6A== X-Forwarded-Encrypted: i=1; AJvYcCXozxbX2z1TPho+On4xG2E7JL2SqbX7K/uNJKH27++xkLL4MEv1Yjd0IudGTqZE7xvzPcIpxA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwX3VOoPRzrpHoj+h+cKcNwOVVk6x8GD+rCa64J25HBX1lzaL8h UOtX2zldvDymOI6JjDqU9i5+nNpjERZdFSS896SOMGpTlfMgyzMG X-Gm-Gg: ASbGnctdf/PwN49SMprf6KO4+1yjuTwlLuTgKPPWN+C16xOcTHhAZdOs3BA9/0ViF+i 3Rw3W5doCFP3QAOtU/8vWY7mWj0zUkhHC6H1MG7SuukRJWEfh9xXUsyQyTprskOuhlIRC2UFN05 SDKPet6rQPwoi/+rxhqM3Cl8q9ayBHXN0MQbMcmrRzCd+gE3Tx8t4YFFnEwJe9W+zok+LE+6opi HU+B3PfENviEMJ5xBV6FncveaVIDPFvPQ4Rs5x/s3WNTyn2z15VGVmfB3F9EuQ63MTWyTdVK7S+ fwoFMJO97bfrzVI= X-Google-Smtp-Source: AGHT+IGZmZVJ4NLtU7esuvhFLftBLcO+i6YKHHyetCoUq80wOzOAq1gGN1P0sURprXyog0Wuu4GcBw== X-Received: by 2002:a05:600c:1907:b0:434:ffd7:6fca with SMTP id 5b1f17b1804b1-4361c34469amr30047765e9.2.1733934711725; Wed, 11 Dec 2024 08:31:51 -0800 (PST) Original-Received: from Wills-MacBook-Pro.local ([2a00:23c7:253d:cd01:21f5:855:55d:d079]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436229d1824sm1593145e9.18.2024.12.11.08.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 08:31:50 -0800 (PST) In-Reply-To: <87wmg643g4.fsf@gmail.com> (Robert Pluim's message of "Wed, 11 Dec 2024 16:58:03 +0100") X-Mailman-Approved-At: Wed, 11 Dec 2024 12:27:06 -0500 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:296857 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Dec 11 2024 at 16:58, Robert Pluim wrote: >>>>>> On Wed, 11 Dec 2024 17:45:59 +0200, Eli Zaretskii sai= d: > > 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. Ah, thanks! I've attached a new patch with the simplification. best -- will --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-custom-args-to-test-compile-step.patch >From 497266302d7ac20be411685c8d7a6dba0126360a Mon Sep 17 00:00:00 2001 From: w08r Date: Wed, 11 Dec 2024 09:31:47 +0000 Subject: [PATCH] Add custom args to test compile step --- lisp/progmodes/go-ts-mode.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 86e74ad58a8..acf458bf63b 100644 --- a/lisp/progmodes/go-ts-mode.el +++ b/lisp/progmodes/go-ts-mode.el @@ -52,6 +52,12 @@ :type '(repeat string) :group 'go) +(defcustom go-ts-mode-test-args nil + "List of extra args for the Go test commands." + :version "31.1" + :type '(repeat string) + :group 'go) + (defvar go-ts-mode--syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?+ "." table) @@ -396,7 +402,8 @@ specifying build tags." "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'" + (string-join go-ts-mode-test-args) (go-ts-mode--get-build-tags-flag) regexp))) -- 2.32.0 --=-=-=--