[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#50299: [PATCH v3 01/27] lint: check-tests-true: Allow #:tests? #t fo
From: |
Maxime Devos |
Subject: |
bug#50299: [PATCH v3 01/27] lint: check-tests-true: Allow #:tests? #t for some build systems. |
Date: |
Thu, 30 Sep 2021 00:47:33 +0200 |
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 527fda165a..534da85b96 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)
@@ -278,6 +279,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 0f51b9ef79..391ebadfc4 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)
@@ -324,6 +326,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
base-commit: 808f9ffbd3106da4c92d2367b118b98196c9e81e
prerequisite-patch-id: 7fdac44e8681baaf419cbf8da78cdebb8b9f9757
prerequisite-patch-id: 1f7f1597b9c85b2b1f9db1044d193bcf6ec8650e
prerequisite-patch-id: 588ca94b9c4603424094a9cc2854c4f9bc83c7e4
prerequisite-patch-id: 82b4951463e8979d1c4cd15e1ca6a36308b21b51
prerequisite-patch-id: 75cdb9eb6b038adfb605253163b94efd51e0276c
--
2.33.0
- bug#50299: [PATCH v3 01/27] lint: check-tests-true: Allow #:tests? #t for some build systems.,
Maxime Devos <=
- bug#50299: [PATCH v3 03/27] gnu: lean: Add bash-minimal., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 04/27] gnu: swi-prolog: Move native-inputs to inputs where appropriate., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 05/27] gnu: swi-prolog: Don't explicitely enable tests., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 08/27] gnu: swi-prolog: Use cross-compiled bash in shebangs., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 06/27] gnu: swi-prolog: Make configuration wok when cross-compiling., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 17/27] gnu: libicns: Don't run tests when cross-compiling., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 13/27] gnu: ruby-ffi-rzmq: Respect #:tests?., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 15/27] gnu: ecl: Don't pretend to enable tests when cross-compiling., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 21/27] gnu: lablgtk: Don't run tests when cross-compiling., Maxime Devos, 2021/09/29
- bug#50299: [PATCH v3 20/27] gnu: ocaml4.07-fftw3: Don't run tests when cross-compiling., Maxime Devos, 2021/09/29