gnu: clitest: Use G-expressions.

* gnu/packages/check.scm (clitest)[arguments]: Rewrite as gexp.  While here,
respect TESTS? in check phase.
This commit is contained in:
Marius Bakke 2022-02-07 22:00:39 +01:00
parent 696e34e721
commit 31ff6a525d
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -220,14 +220,16 @@ (define-public clitest
"1p745mxiq3hgi3ywfljs5sa1psi06awwjxzw0j9c2xx1b09yqv4a")))) "1p745mxiq3hgi3ywfljs5sa1psi06awwjxzw0j9c2xx1b09yqv4a"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases
#~(modify-phases %standard-phases
;; This package is distributed as a single shell script and comes ;; This package is distributed as a single shell script and comes
;; without a proper build system. ;; without a proper build system.
(delete 'configure) (delete 'configure)
(delete 'build) (delete 'build)
(replace 'check (replace 'check
(lambda _ (lambda* (#:key tests? #:allow-other-keys)
(when tests?
(substitute* "test.md" (substitute* "test.md"
;; One test looks for an error from grep in the form "grep: foo", ;; One test looks for an error from grep in the form "grep: foo",
;; but our grep returns the absolute file name on errors. Adjust ;; but our grep returns the absolute file name on errors. Adjust
@ -236,14 +238,13 @@ (define-public clitest
"sed 's/.*e*grep: .*/")) "sed 's/.*e*grep: .*/"))
(setenv "HOME" "/tmp") (setenv "HOME" "/tmp")
(invoke "./clitest" "test.md"))) (invoke "./clitest" "test.md"))))
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((out (assoc-ref outputs "out"))) (install-file "clitest" (string-append #$output "/bin"))
(install-file "clitest" (string-append out "/bin"))
(install-file "README.md" (install-file "README.md"
(string-append out "/share/doc/clitest-" (string-append #$output "/share/doc/clitest-"
,version)))))))) #$(package-version this-package))))))))
(native-inputs (native-inputs
(list perl)) ;for tests (list perl)) ;for tests
(inputs (inputs