bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#50299: lint: check-tests-true: Allow #:tests? #t for emacs-build-sys


From: Maxime Devos
Subject: bug#50299: lint: check-tests-true: Allow #:tests? #t for emacs-build-system.
Date: Tue, 07 Sep 2021 14:34:21 +0200
User-agent: Evolution 3.34.2

Hi

The attached patch should fix this.

Greetings,
Maxime.
From c8efd59560509381920cbfe915279bd16077552d Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 7 Sep 2021 14:25:43 +0200
Subject: [PATCH] lint: check-tests-true: Allow #:tests? #t for
 emacs-build-system.

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.

* guix/lint.scm (check-tests-true): Do not warn if the build system
  is emacs-build-system.

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

diff --git a/guix/lint.scm b/guix/lint.scm
index 8e80aae938..f708465ed8 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 emacs)
   #:use-module (guix diagnostics)
   #:use-module (guix download)
   #:use-module (guix ftp-client)
@@ -279,6 +280,10 @@ 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.
+           (not (eq? emacs-build-system (package-build-system package)))
            ;; 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 0f51b9ef79..6aa2ac00c1 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -35,6 +35,7 @@
   #:use-module (guix tests http)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix build-system emacs)
   #:use-module (guix build-system gnu)
   #:use-module (guix packages)
   #:use-module (guix lint)
@@ -324,6 +325,15 @@
                              `(#: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)))
+
 (test-equal "inputs: pkg-config is probably a native input"
   "'pkg-config' should probably be a native input"
   (single-lint-warning-message
-- 
2.33.0

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]