me
/
guix
Archived
1
0
Fork 0

build-system: emacs: Add improved check phase.

* guix/build-system/emacs.scm (emacs-build): Add #:test-command keyword
argument. Remove #:configure-flags and #:test-target keyword arguments.
* guix/build/emacs-build-system.scm (check): New procedure.
(%standard-phases): Register check phase after the build phase.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
master
Maxim Cournoyer 2018-02-11 00:51:26 -05:00 committed by Arun Isaac
parent 8a8fa82e72
commit facc0a96a1
No known key found for this signature in database
GPG Key ID: 2E25EE8B61802BB3
2 changed files with 21 additions and 4 deletions

View File

@ -84,8 +84,7 @@
#:key source #:key source
(tests? #f) (tests? #f)
(parallel-tests? #t) (parallel-tests? #t)
(test-target "test") (test-command ''("make" "check"))
(configure-flags ''())
(phases '(@ (guix build emacs-build-system) (phases '(@ (guix build emacs-build-system)
%standard-phases)) %standard-phases))
(outputs '("out")) (outputs '("out"))
@ -110,9 +109,8 @@
source) source)
(source (source
source)) source))
#:configure-flags ,configure-flags
#:system ,system #:system ,system
#:test-target ,test-target #:test-command ,test-command
#:tests? ,tests? #:tests? ,tests?
#:phases ,phases #:phases ,phases
#:outputs %outputs #:outputs %outputs

View File

@ -158,6 +158,24 @@ store in '.el' files."
(substitute-program-names)))) (substitute-program-names))))
#t)) #t))
(define* (check #:key tests? (test-command '("make" "check"))
(parallel-tests? #t) #:allow-other-keys)
"Run the tests by invoking TEST-COMMAND.
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."
(match-let (((test-program . args) test-command))
(let ((using-make? (string=? test-program "make")))
(if tests?
(apply invoke test-program
`(,@args
,@(if (and using-make? parallel-tests?)
`("-j" ,(number->string (parallel-job-count)))
'())))
(begin
(format #t "test suite not run~%")
#t)))))
(define* (install #:key outputs (define* (install #:key outputs
(include %default-include) (include %default-include)
(exclude %default-exclude) (exclude %default-exclude)
@ -256,6 +274,7 @@ second hyphen. This corresponds to 'name-version' as used in ELPA packages."
;; Move the build phase after install: the .el files are byte compiled ;; Move the build phase after install: the .el files are byte compiled
;; directly in the store. ;; directly in the store.
(delete 'build) (delete 'build)
(replace 'check check)
(replace 'install install) (replace 'install install)
(add-after 'install 'build build) (add-after 'install 'build build)
(add-after 'install 'make-autoloads make-autoloads) (add-after 'install 'make-autoloads make-autoloads)