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 10:18:04 +0000 Message-ID: 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="33609"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 74786@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 11 12:29:23 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 1tLKu9-0008Sp-RJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 12:29:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLKtt-0002o4-9u; Wed, 11 Dec 2024 06:29:05 -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 1tLKtr-0002nk-Aq for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 06:29:03 -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 1tLKtr-00083C-2B for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 06:29: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:From:To:Subject; bh=NfiAT13qefzL/YoY03FLc3z0+geEJlY8c4VVhY6kAhQ=; b=i7asSK2YPHZ9DbQuEo5NcWnFWpqCvvjvGl2RUhQdTKX45AbxUL++7qUuqL/zPbNU509q/8bMpsNRIC+aLHan3wmw9aVqjq517DAifsm9djV+WyEcTn4K7MsmVmCl1oRPNLBJIpw/NWbdqcMJLfMI3qUSUMq1Y5FDDDxWCnoFy1Vf2cGY8cNKEB0wffqImgnaxETRtytujLfxvVv/iybjFomXWsCgZFJTLGbm42uaNxQZPJm5jHAwY+ufzoIvWqt0QTPNqGqqRgx1oryX6khRCTyyMiAGEQg7K/Ceehz0CJ49e64mgLz7OZT4YT0wpMunDEwQJgHxM1krWcx0AjWIRA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLKtq-0000JD-RY for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 06:29:02 -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 11:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17339165091072 (code B ref -1); Wed, 11 Dec 2024 11:29:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Dec 2024 11:28:29 +0000 Original-Received: from localhost ([127.0.0.1]:33235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLKtI-0000HC-Da for submit@debbugs.gnu.org; Wed, 11 Dec 2024 06:28:29 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:44130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLJnI-0003lL-LN for submit@debbugs.gnu.org; Wed, 11 Dec 2024 05:18:13 -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 1tLJnI-0006HV-Dm for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 05:18:12 -0500 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLJnG-00009u-Ky for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 05:18:12 -0500 Original-Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-434ab938e37so42487305e9.0 for ; Wed, 11 Dec 2024 02:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733912287; x=1734517087; darn=gnu.org; h=mime-version:message-id:date:user-agent:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=NfiAT13qefzL/YoY03FLc3z0+geEJlY8c4VVhY6kAhQ=; b=lh2O+o35DRJebODbMIMoxez+5cJdB0C+t4Ty7o8YXbIc6W6Gl9EfBdcQSbkMe6lyxi rZ/n3FD5NE5o7N0YDNdfofCDPAEiPyJMyKXyrX12t5KK/HQj8lb9uedIezmZODBHHeRC wgM+GjQh6f0N0dsaMePu7OIyKaKREp1qm2X9t1XWDDW+bbtFLN413WIL33BKEIk1Abjb 0RbBJZeS2IUfMZvz2fmFZvR7+tRmZoWTiQICYE2WRMlHFfKILbuwOVU6Sci+xRPnSVoF WDrfGNJPVXwFR/lOy4ATPunzDP4lvBGcs4IR6QInQIcBGKX49non8KsrXL5AnFf23sn5 12vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733912287; x=1734517087; h=mime-version:message-id:date:user-agent:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NfiAT13qefzL/YoY03FLc3z0+geEJlY8c4VVhY6kAhQ=; b=mOlXcybUsnuyFAx3vcG5OnEGN93viZC6rRVrTTU0qWOfrnOBRsmHHGQu9SOB1JFOjU n418O41qtFvIJh1Pr12Xegwb/x6NXN3LRwU5uvGdDt6chxPX04jZMzNQXqJMDsm0dTPO 3juHYxzT00YwHSI1sn5uSA5aUBpbfYikqGIp14STNWgs+ixKlqDzpSlzK/v9db8TYHQR s0t3Cis53Hth1kP7HMO0N7UnxKVBUW+OjmQETK1AqaSP+SzEhF4YLs4cQjArUjISVd64 9m86JciiCvpLj8enB3Hbi6WYSiql7KXCvpxYmmUN5fa2x3DkbBwaJQknm9TG/lgBiaoa c4Rw== X-Gm-Message-State: AOJu0YxL363LaeGiRdR/BnCpS4DH39/kA8jXkhKsiZCZMj4hqONDupc+ femZ2jR+G304yn/THjbbq74s2aJekXlmdZ6wYBGFKKTN6yfbCTU6+eVhlraM X-Gm-Gg: ASbGncustBaq17StIgR4DouvkzSh7C5kb6AF6cT83SOk6M7qcfMQ8MooXfbf4QDps7c kOuwdeBz5rw0uW777YEBD4vpHEaK0DCFHe+XOejwDOAiapvI3Z+3/Mjg7T7whr+f9ZRS+HylLto jeOlsW6QXICHzahyP/TzF8lW6DJGnABWBj+HXVTSWsH/SZ+QLufxtwH/VDA8RvYEh5ux1Ogl5PK RXmyOMuuF0NZCeepqTbwCyWkkY4DyuS8NgRvuYlj4FTO6V5oYOjBia8NIHbdIQBAv6Qf+HOpeKL n1huXJ/KIPGADqc= X-Google-Smtp-Source: AGHT+IHSgprHWHAS6XCH5Jn9DLDa7B1sR9PSrwoOwRt2Q5IVKsAR2lO20vCz7etCCoFSWjZWQ/ygUw== X-Received: by 2002:a05:600c:4f86:b0:434:a711:ace4 with SMTP id 5b1f17b1804b1-4361c38cceamr18052815e9.17.1733912287063; Wed, 11 Dec 2024 02:18:07 -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-4361f511cfbsm9547685e9.20.2024.12.11.02.18.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 02:18:05 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=will.08rien@gmail.com; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 11 Dec 2024 06:28:27 -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:296819 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Hi, First time trying to contribute here, so apologies for any wrong doing. I haven't signed FSF papers; would be happy to but believe this may fit in to tiny patch territory. This is a feature request to pass custom flags down to the test compile step in go-ts-mode-test-... functions. Specifically I wanted to add the coverprofile argument to unit test invocation. The attached patch seems to do the trick for me. In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin23.6.0, NS appkit-2487.70 Version 14.6.1 (Build 23G93)) of 2024-09-02 built on Wills-MacBook-Pro.local Windowing system distributor 'Apple', version 10.3.2575 System Description: macOS 15.1.1 Configured using: 'configure --disable-silent-rules --prefix=/nix/store/2hqk7brndnbi3r5c2rjyhx0k19m1q77j-w08r-emacs-92ea393a16e --enable-locallisppath=/nix/store/2hqk7brndnbi3r5c2rjyhx0k19m1q77j-w08r-emacs-92ea393a16e/site-lisp --without-dbus --without-imagemagick --with-mailutils --disable-ns-self-contained --with-cairo --with-modules --with-xml2 --with-gnutls --with-rsvg --with-native-compilation --with-gnutls=ifavailable --enable-mac-app=/nix/store/2hqk7brndnbi3r5c2rjyhx0k19m1q77j-w08r-emacs-92ea393a16e/Applications --with-xwidgets --with-tree-sitter 'CFLAGS=-O3 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/ -framework AppKit' 'CPPFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/ -I/Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk//System/Library/Frameworks/AppKit.framework/Versions/C/Headers -I/nix/store/d3f47kd7kr5xdpcgs3xx7bg2mx5fbb0z-libgccjit-12.2.0/include' 'LDFLAGS=-O3 -L /nix/store/d3f47kd7kr5xdpcgs3xx7bg2mx5fbb0z-libgccjit-12.2.0/lib'' best -- will --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Add-custom-args-to-test-compile-step.patch >From 0f3059391479511013c560e16858f453d342cba5 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 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/go-ts-mode.el b/lisp/progmodes/go-ts-mode.el index 86e74ad58a8..b926e6d7c64 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-ts-mode 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) @@ -392,11 +398,20 @@ specifying build tags." (format "-tags %s" (string-join go-ts-mode-build-tags ",")) "")) +(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) + "")) + (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))) -- 2.32.0 --=-=-=--