gnu: julia-build-system: Enable tests.

This commit is contained in:
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 (define* (julia-build store name inputs
#:key source #:key source
(tests? #f) (tests? #t)
(phases '(@ (guix build julia-build-system) (phases '(@ (guix build julia-build-system)
%standard-phases)) %standard-phases))
(outputs '("out")) (outputs '("out"))

View File

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