diff options
Diffstat (limited to 'tests/profiles.scm')
-rw-r--r-- | tests/profiles.scm | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm index 8ead6e6968..d405f6453e 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,11 +18,25 @@ (define-module (test-profiles) #:use-module (guix profiles) + #:use-module (guix store) + #:use-module (guix monads) + #:use-module (guix packages) + #:use-module (guix derivations) + #:use-module (gnu packages bootstrap) #:use-module (ice-9 match) #:use-module (srfi srfi-64)) ;; Test the (guix profile) module. +(define %store + (open-connection)) + +(define guile-for-build + (package-derivation %store %bootstrap-guile)) + +;; Make it the default. +(%guile-for-build guile-for-build) + ;; Example manifest entries. @@ -30,7 +44,7 @@ (manifest-entry (name "guile") (version "2.0.9") - (path "/gnu/store/...") + (item "/gnu/store/...") (output "out"))) (define guile-2.0.9:debug @@ -87,6 +101,19 @@ (null? (manifest-entries m3)) (null? (manifest-entries m4))))))) +(test-assert "profile-derivation" + (run-with-store %store + (mlet* %store-monad + ((entry -> (package->manifest-entry %bootstrap-guile)) + (guile (package->derivation %bootstrap-guile)) + (drv (profile-derivation (manifest (list entry)))) + (profile -> (derivation->output-path drv)) + (bindir -> (string-append profile "/bin")) + (_ (built-derivations (list drv)))) + (return (and (file-exists? (string-append bindir "/guile")) + (string=? (dirname (readlink bindir)) + (derivation->output-path guile))))))) + (test-end "profiles") |