[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/06: build-system: emacs: Add improved check phase.
From: |
Arun Isaac |
Subject: |
04/06: build-system: emacs: Add improved check phase. |
Date: |
Thu, 19 Apr 2018 15:24:25 -0400 (EDT) |
arunisaac pushed a commit to branch master
in repository guix.
commit facc0a96a171631bd346b37ffd47bcda6d82e892
Author: Maxim Cournoyer <address@hidden>
Date: Sun Feb 11 00:51:26 2018 -0500
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 <address@hidden>
---
guix/build-system/emacs.scm | 6 ++----
guix/build/emacs-build-system.scm | 19 +++++++++++++++++++
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/guix/build-system/emacs.scm b/guix/build-system/emacs.scm
index d9f1a8d..ef6d1b3 100644
--- a/guix/build-system/emacs.scm
+++ b/guix/build-system/emacs.scm
@@ -84,8 +84,7 @@
#:key source
(tests? #f)
(parallel-tests? #t)
- (test-target "test")
- (configure-flags ''())
+ (test-command ''("make" "check"))
(phases '(@ (guix build emacs-build-system)
%standard-phases))
(outputs '("out"))
@@ -110,9 +109,8 @@
source)
(source
source))
- #:configure-flags ,configure-flags
#:system ,system
- #:test-target ,test-target
+ #:test-command ,test-command
#:tests? ,tests?
#:phases ,phases
#:outputs %outputs
diff --git a/guix/build/emacs-build-system.scm
b/guix/build/emacs-build-system.scm
index da17eb1..094b047 100644
--- a/guix/build/emacs-build-system.scm
+++ b/guix/build/emacs-build-system.scm
@@ -158,6 +158,24 @@ store in '.el' files."
(substitute-program-names))))
#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
(include %default-include)
(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
;; directly in the store.
(delete 'build)
+ (replace 'check check)
(replace 'install install)
(add-after 'install 'build build)
(add-after 'install 'make-autoloads make-autoloads)
- branch master updated (2bb915e -> 9490c41), Arun Isaac, 2018/04/19
- 01/06: build-system: emacs: Search all inputs for Emacs Lisp directories., Arun Isaac, 2018/04/19
- 03/06: build-system: emacs: Replace system* with invoke., Arun Isaac, 2018/04/19
- 02/06: gnu: emacs-pdf-tools: Fix byte compilation., Arun Isaac, 2018/04/19
- 04/06: build-system: emacs: Add improved check phase.,
Arun Isaac <=
- 05/06: gnu: Adapt Emacs packages to use the new check phase., Arun Isaac, 2018/04/19
- 06/06: gnu: ert-runner: Adjust ert-runner wrapper to honor EMACSLOADPATH., Arun Isaac, 2018/04/19