gnu: julia-build-system: Enable tests.

master
nixo 2019-10-13 15:15:05 +02:00
parent e78c808796
commit 97139da96b
2 changed files with 13 additions and 9 deletions

View File

@ -75,7 +75,7 @@
(define* (julia-build store name inputs
#:key source
(tests? #f)
(tests? #t)
(phases '(@ (guix build julia-build-system)
%standard-phases))
(outputs '("out"))

View File

@ -78,13 +78,17 @@
(invoke-julia (string-append "using " package)))
#t)
(define* (check #:key source inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(package (strip-store-file-name source))
(builddir (string-append out "/share/julia/")))
(setenv "JULIA_DEPOT_PATH" builddir)
(setenv "JULIA_LOAD_PATH" (generate-load-path inputs outputs))
(invoke-julia (string-append "using Pkg;Pkg.test(\"" package "\")")))
(define* (check #:key tests? source inputs outputs #:allow-other-keys)
(when tests?
(let* ((out (assoc-ref outputs "out"))
(package (strip-store-file-name source))
(builddir (string-append out "/share/julia/")))
(setenv "JULIA_DEPOT_PATH" builddir)
(setenv "JULIA_LOAD_PATH" (generate-load-path inputs outputs))
(display builddir)
(invoke "julia" (string-append builddir
"packages/"
package "/test/runtests.jl"))))
#t)
(define (julia-create-package-toml outputs source
@ -119,7 +123,7 @@ version = \"" version "\"
(delete 'check) ; tests must be run after installation
(replace 'install install)
(add-after 'install 'precompile precompile)
;; (add-after 'install 'check check)
(add-after 'install 'check check)
;; TODO: In the future we could add a "system-image-generation" phase
;; where we use PackageCompiler.jl to speed up package loading times
(delete 'configure)