mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build-system: emacs: Guess test framework.
* guix/build/emacs-build-system (check-command): New variable. (check): Use it. * guix/build-system/emacs.scm (emacs-build)[test-command]: Set to #f.
This commit is contained in:
parent
3455034376
commit
d1ac3f1947
2 changed files with 24 additions and 13 deletions
|
@ -84,7 +84,7 @@
|
||||||
#:key source
|
#:key source
|
||||||
(tests? (not (%current-target-system)))
|
(tests? (not (%current-target-system)))
|
||||||
(parallel-tests? #t)
|
(parallel-tests? #t)
|
||||||
(test-command ''("make" "check"))
|
(test-command #f) ; inferred in emacs-build-system
|
||||||
(phases '%standard-phases)
|
(phases '%standard-phases)
|
||||||
(outputs '("out"))
|
(outputs '("out"))
|
||||||
(include (quote %default-include))
|
(include (quote %default-include))
|
||||||
|
|
|
@ -223,23 +223,34 @@ locations in the store in '.el' files."
|
||||||
(let ((name (store-directory->elpa-name-version (assoc-ref outputs "out"))))
|
(let ((name (store-directory->elpa-name-version (assoc-ref outputs "out"))))
|
||||||
(and=> (find-root-library-file name) write-pkg-file)))
|
(and=> (find-root-library-file name) write-pkg-file)))
|
||||||
|
|
||||||
(define* (check #:key tests? (test-command '("make" "check"))
|
(define (check-command test-command)
|
||||||
|
(cond
|
||||||
|
(test-command test-command)
|
||||||
|
((which "buttercup") '("buttercup" "-L" "."))
|
||||||
|
((which "ert-runner") '("ert-runner"))
|
||||||
|
((file-exists? "Makefile") '("make" "check"))
|
||||||
|
(else #f)))
|
||||||
|
|
||||||
|
(define* (check #:key tests? test-command
|
||||||
(parallel-tests? #t) #:allow-other-keys)
|
(parallel-tests? #t) #:allow-other-keys)
|
||||||
"Run the tests by invoking TEST-COMMAND.
|
"Run the tests by invoking TEST-COMMAND.
|
||||||
|
|
||||||
When TEST-COMMAND uses make and PARALLEL-TESTS is #t, the tests are run in
|
When TEST-COMMAND uses make and PARALLEL-TESTS is #t, the tests are run in
|
||||||
parallel. PARALLEL-TESTS? is ignored when using a non-make TEST-COMMAND."
|
parallel. PARALLEL-TESTS? is ignored when using a non-make TEST-COMMAND."
|
||||||
(match-let (((test-program . args) test-command))
|
(match (and tests? (check-command test-command))
|
||||||
(let ((using-make? (string=? test-program "make")))
|
((test-program . args)
|
||||||
(if tests?
|
(let ((using-make? (string=? test-program "make")))
|
||||||
(apply invoke test-program
|
(apply invoke test-program
|
||||||
`(,@args
|
`(,@args
|
||||||
,@(if (and using-make? parallel-tests?)
|
,@(if (and using-make? parallel-tests?)
|
||||||
`("-j" ,(number->string (parallel-job-count)))
|
`("-j" ,(number->string (parallel-job-count)))
|
||||||
'())))
|
'())))))
|
||||||
(begin
|
(#f
|
||||||
(format #t "test suite not run~%")
|
(if tests?
|
||||||
#t)))))
|
(begin
|
||||||
|
(display "warning: test system not found.\n")
|
||||||
|
(display "note: this will be an error in the future.\n"))
|
||||||
|
(display "test suite not run\n")))))
|
||||||
|
|
||||||
(define* (install #:key outputs
|
(define* (install #:key outputs
|
||||||
(include %default-include)
|
(include %default-include)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue