From 97139da96b6c03a2b4aa25d73f64de8047440b86 Mon Sep 17 00:00:00 2001 From: nixo Date: Sun, 13 Oct 2019 15:15:05 +0200 Subject: [PATCH] gnu: julia-build-system: Enable tests. --- guix/build-system/julia.scm | 2 +- guix/build/julia-build-system.scm | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/guix/build-system/julia.scm b/guix/build-system/julia.scm index 488fe9bb1d..d3cb41c054 100644 --- a/guix/build-system/julia.scm +++ b/guix/build-system/julia.scm @@ -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")) diff --git a/guix/build/julia-build-system.scm b/guix/build/julia-build-system.scm index ff6fcf5fe3..11e9e58f96 100644 --- a/guix/build/julia-build-system.scm +++ b/guix/build/julia-build-system.scm @@ -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)