gnu: src: Respect #:tests? argument.

* gnu/packages/version-control.scm (src)[arguments]: Skip the 'check
phase when #:tests? is false.

Change-Id: Ic39cdb1e9a158d16d022f6e41a954b567731b124
This commit is contained in:
Tobias Geerinckx-Rice 2024-09-29 02:00:00 +02:00
parent b1df929e1b
commit a47d7af227
No known key found for this signature in database
GPG key ID: 0DB0FF884F556D79

View file

@ -3449,11 +3449,12 @@ (define-public src
(wrap-program prog (wrap-program prog
`("PATH" ":" prefix (,(dirname rcs))))))) `("PATH" ":" prefix (,(dirname rcs)))))))
(replace 'check (replace 'check
(lambda _ (lambda* (#:key tests? #:allow-other-keys)
(setenv "HOME" (getenv "TMPDIR")) (when tests?
(invoke "git" "config" "--global" "user.name" "guix") (setenv "HOME" (getenv "TMPDIR"))
(invoke "git" "config" "--global" "user.email" "guix") (invoke "git" "config" "--global" "user.name" "guix")
(invoke "./srctest")))))) (invoke "git" "config" "--global" "user.email" "guix")
(invoke "./srctest")))))))
(native-inputs (native-inputs
(list asciidoc (list asciidoc
;; For testing. ;; For testing.