unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 50299@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: bug#50299: [PATCH v4 01/25] lint: check-tests-true: Allow #:tests? #t for some build systems.
Date: Fri, 31 Dec 2021 12:14:43 +0000	[thread overview]
Message-ID: <20211231121507.70323-2-maximedevos@telenet.be> (raw)
In-Reply-To: <20211231121507.70323-1-maximedevos@telenet.be>

emacs-build-system sets #:tests? #f by default, so the linter
shouldn't warn if #:tests? #t is set for packages using
emacs-build-system.  Likewise for texlive-build-system

* guix/lint.scm (check-tests-true): Do not warn if the build system
  is emacs-build-system or texlive-build-system.
* tests/lint.scm
  ("tests-true: #:tests? #t acceptable for emacs packages")
  ("tests-true: #:tests? #t acceptable for texlive packages"): New tests.

Fixes: <https://issues.guix.gnu.org/50299>
Reported-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
 guix/lint.scm  | 11 +++++++++++
 tests/lint.scm | 21 +++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/guix/lint.scm b/guix/lint.scm
index 379bd0e80b..8655f3aea7 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -34,6 +34,7 @@
   #:use-module (guix store)
   #:autoload   (guix base16) (bytevector->base16-string)
   #:use-module (guix base32)
+  #:use-module (guix build-system)
   #:use-module (guix diagnostics)
   #:use-module (guix download)
   #:use-module (guix ftp-client)
@@ -279,6 +280,16 @@ superfluous when building natively and incorrect when cross-compiling."
              (eq? tests? #t))
            (package-arguments package)))
   (if (and (tests-explicitly-enabled?)
+           ;; emacs-build-system sets #:tests? #f by default, therefore
+           ;; writing #:tests? #t in package definitions using
+           ;; emacs-build-system is reasonable.  Likewise for
+           ;; texlive-build-system.
+           ;;
+           ;; Compare the name of the build system instead of the build system
+           ;; itself to avoid loading unnecessary modules when only a few
+           ;; modules are linted.
+           (not (memq (build-system-name (package-build-system package))
+                      '(emacs texlive)))
            ;; Some packages, e.g. gnutls, set #:tests?
            ;; differently depending on whether it is being
            ;; cross-compiled.
diff --git a/tests/lint.scm b/tests/lint.scm
index 76c2a70b3a..6bb24370da 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -35,6 +35,8 @@
   #:use-module (guix tests http)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix build-system texlive)
+  #:use-module (guix build-system emacs)
   #:use-module (guix build-system gnu)
   #:use-module (guix packages)
   #:use-module (guix lint)
@@ -338,6 +340,25 @@
                              `(#:tests? ,(not (%current-target-system)))))))
     (check-tests-true pkg)))
 
+;; The emacs-build-system sets #:tests? #f by default.
+(test-equal "tests-true: #:tests? #t acceptable for emacs packages"
+  '()
+  (let ((pkg (dummy-package "x"
+                            (build-system emacs-build-system)
+                            (arguments
+                             `(#:tests? #t)))))
+    (check-tests-true pkg)))
+
+;; Likewise, though the 'check' phase is deleted by default,
+;; so #:tests? #t won't be useful by itself.
+(test-equal "tests-true: #:tests? #t acceptable for texlive packages"
+  '()
+  (let ((pkg (dummy-package "x"
+                            (build-system texlive-build-system)
+                            (arguments
+                             `(#:tests? #t)))))
+    (check-tests-true pkg)))
+
 (test-equal "inputs: pkg-config is probably a native input"
   "'pkg-config' should probably be a native input"
   (single-lint-warning-message
-- 
2.30.2





  reply	other threads:[~2021-12-31 12:21 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 15:25 bug#50299: The check-tests-true lint check is incorrect for Emacs packages Maxim Cournoyer
2021-09-07 12:34 ` bug#50299: lint: check-tests-true: Allow #:tests? #t for emacs-build-system Maxime Devos
2021-09-23  3:41   ` bug#50299: The check-tests-true lint check is incorrect for Emacs packages Maxim Cournoyer
2021-09-27 15:44     ` Maxime Devos
2021-09-27 15:45 ` bug#50299: [PATCH v2 01/27] lint: check-tests-true: Allow #:tests? #t for some build systems Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 02/27] gnu: lean: Set #:tests? appropriately when cross-compiling Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 03/27] gnu: lean: Add bash-minimal Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 04/27] gnu: swi-prolog: Move native-inputs to inputs where appropriate Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 05/27] gnu: swi-prolog: Don't explicitely enable tests Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 06/27] gnu: swi-prolog: Make configuration wok when cross-compiling Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 07/27] gnu: swi-prolog: Don't use 'cc' Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 08/27] gnu: swi-prolog: Use cross-compiled bash in shebangs Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 09/27] gnu: swi-prolog: Set PROG_SWIPL when cross-compiling Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 10/27] gnu: ruby-yard-with-tests: Don't enable tests " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 11/27] gnu: ruby-byebug-11: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 12/27] gnu: ruby-ffi-rzmq: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 13/27] gnu: ruby-ffi-rzmq: Respect #:tests? Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 14/27] gnu: go-1.16: Don't enable tests when cross-compiling Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 15/27] gnu: ecl: Don't pretend to " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 16/27] gnu: perl-unicode-utf8: Don't run " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 17/27] gnu: libicns: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 18/27] gnu: python2-empy: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 19/27] gnu: python2-promise: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 20/27] gnu: ocaml4.07-fftw3: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 21/27] gnu: lablgtk: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 22/27] gnu: belcard: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 23/27] gnu: pjproject: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 24/27] gnu: tdlib: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 25/27] gnu: extra-cmake-modules: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 26/27] gnu: inkscape-1.1: " Maxime Devos
2021-09-27 15:45   ` bug#50299: [PATCH v2 27/27] gnu: ghc-bsb-http-chunked: " Maxime Devos
2021-09-28  1:14   ` bug#50299: [PATCH v2 01/27] lint: check-tests-true: Allow #:tests? #t for some build systems Maxim Cournoyer
2021-09-29 22:48     ` Maxime Devos
2021-09-29 22:47 ` bug#50299: [PATCH v3 " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 02/27] gnu: lean: Set #:tests? appropriately when cross-compiling Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 03/27] gnu: lean: Add bash-minimal Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 04/27] gnu: swi-prolog: Move native-inputs to inputs where appropriate Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 05/27] gnu: swi-prolog: Don't explicitely enable tests Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 06/27] gnu: swi-prolog: Make configuration wok when cross-compiling Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 07/27] gnu: swi-prolog: Don't use 'cc' Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 08/27] gnu: swi-prolog: Use cross-compiled bash in shebangs Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 09/27] gnu: swi-prolog: Set PROG_SWIPL when cross-compiling Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 10/27] gnu: ruby-yard-with-tests: Don't enable tests " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 11/27] gnu: ruby-byebug-11: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 12/27] gnu: ruby-ffi-rzmq: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 13/27] gnu: ruby-ffi-rzmq: Respect #:tests? Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 14/27] gnu: go-1.16: Don't enable tests when cross-compiling Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 15/27] gnu: ecl: Don't pretend to " Maxime Devos
2021-10-11 12:13     ` zimoun
2021-10-15 20:45       ` Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 16/27] gnu: perl-unicode-utf8: Don't run " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 17/27] gnu: libicns: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 18/27] gnu: python2-empy: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 19/27] gnu: python2-promise: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 20/27] gnu: ocaml4.07-fftw3: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 21/27] gnu: lablgtk: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 22/27] gnu: belcard: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 23/27] gnu: pjproject: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 24/27] gnu: tdlib: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 25/27] gnu: extra-cmake-modules: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 26/27] gnu: inkscape-1.1: " Maxime Devos
2021-09-29 22:47   ` bug#50299: [PATCH v3 27/27] gnu: ghc-bsb-http-chunked: " Maxime Devos
2021-12-31 12:14 ` bug#50299: [PATCH v4 00/25] Fix 'check-tests-true' linter and some packages Maxime Devos
2021-12-31 12:14   ` Maxime Devos [this message]
2021-12-31 12:14   ` bug#50299: [PATCH v4 02/25] gnu: lean: Don't run tests when cross-compiling Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 03/25] gnu: lean: Add bash-minimal Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 04/25] gnu: swi-prolog: Move native-inputs to inputs where appropriate Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 05/25] gnu: swi-prolog: Run tests conditionally Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 06/25] gnu: swi-prolog: Make configuration wok when cross-compiling Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 07/25] gnu: swi-prolog: Don't use 'cc' Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 08/25] gnu: swi-prolog: Use cross-compiled bash in shebangs Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 09/25] gnu: swi-prolog: Set PROG_SWIPL when cross-compiling Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 10/25] gnu: swi-prolog: Correct reference to 'bin/swi-prolog' Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 11/25] gnu: ruby-yard-with-tests: Run tests conditionally Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 12/25] gnu: ruby-ffi-rzmq: " Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 13/25] gnu: ruby-ffi-rzmq: Respect #:tests? Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 14/25] gnu: go-1.16: Don't run tests when cross-compiling Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 15/25] gnu: ecl: Run tests conditionally Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 16/25] gnu: perl-unicode-utf8: " Maxime Devos
2021-12-31 12:14   ` bug#50299: [PATCH v4 17/25] gnu: libicns: " Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 18/25] gnu: python2-empy: " Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 19/25] gnu: python2-promise: " Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 20/25] gnu: lablgtk: " Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 21/25] gnu: belcard: " Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 22/25] gnu: pjproject: " Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 23/25] gnu: tdlib: " Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 24/25] gnu: extra-cmake-modules: Don't run tests when cross-compiling Maxime Devos
2021-12-31 12:15   ` bug#50299: [PATCH v4 25/25] gnu: ghc-bsb-http-chunked: " Maxime Devos
2022-03-04 13:00 ` bug#50299: [PATCH v5 00/24] Fix 'check-tests-true' linter and some packages Maxime Devos
2022-03-04 13:00   ` bug#50299: [PATCH v5 01/24] lint: check-tests-true: Allow #:tests? #t for some build systems Maxime Devos
2022-03-04 13:00   ` bug#50299: [PATCH v5 02/24] gnu: lean: Don't run tests when cross-compiling Maxime Devos
2022-03-04 13:00   ` bug#50299: [PATCH v5 03/24] gnu: lean: Add bash-minimal Maxime Devos
2022-03-04 13:00   ` bug#50299: [PATCH v5 04/24] gnu: swi-prolog: Move native-inputs to inputs where appropriate Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 05/24] gnu: swi-prolog: Run tests conditionally Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 06/24] gnu: swi-prolog: Make configuration wok when cross-compiling Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 07/24] gnu: swi-prolog: Don't use 'cc' Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 08/24] gnu: swi-prolog: Use cross-compiled bash in shebangs Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 09/24] gnu: swi-prolog: Set PROG_SWIPL when cross-compiling Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 10/24] gnu: swi-prolog: Correct reference to 'bin/swi-prolog' Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 11/24] gnu: ruby-yard-with-tests: Run tests conditionally Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 12/24] gnu: ruby-ffi-rzmq: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 13/24] gnu: ruby-ffi-rzmq: Respect #:tests? Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 14/24] gnu: go-1.16: Don't run tests when cross-compiling Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 15/24] gnu: ecl: Run tests conditionally Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 16/24] gnu: perl-unicode-utf8: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 17/24] gnu: libicns: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 18/24] gnu: python2-empy: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 19/24] gnu: python2-promise: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 20/24] gnu: lablgtk: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 21/24] gnu: belcard: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 22/24] gnu: tdlib: " Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 23/24] gnu: extra-cmake-modules: Don't run tests when cross-compiling Maxime Devos
2022-03-04 13:01   ` bug#50299: [PATCH v5 24/24] gnu: ghc-bsb-http-chunked: " Maxime Devos
2022-03-12  4:43   ` bug#50299: The check-tests-true lint check is incorrect for Emacs packages Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211231121507.70323-2-maximedevos@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=50299@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).