tests: Use 'test-assertm' for profiles.

* tests/profiles.scm (test-assertm): New macro.
  ("profile-derivation"): Use it instead of 'test-assert' +
  'run-with-store'.
This commit is contained in:
Ludovic Courtès 2014-12-15 22:47:55 +01:00
parent 6cb89466ba
commit ebf5ad46db

View file

@ -35,6 +35,11 @@ (define-module (test-profiles)
(define %store (define %store
(open-connection-for-tests)) (open-connection-for-tests))
(define-syntax-rule (test-assertm name exp)
(test-assert name
(run-with-store %store exp
#:guile-for-build (%guile-for-build))))
;; Example manifest entries. ;; Example manifest entries.
(define guile-1.8.8 (define guile-1.8.8
@ -156,8 +161,7 @@ (define glibc
(equal? (list glibc) install) (equal? (list glibc) install)
(equal? (list (cons guile-1.8.8 guile-2.0.9)) upgrade))))) (equal? (list (cons guile-1.8.8 guile-2.0.9)) upgrade)))))
(test-assert "profile-derivation" (test-assertm "profile-derivation"
(run-with-store %store
(mlet* %store-monad (mlet* %store-monad
((entry -> (package->manifest-entry %bootstrap-guile)) ((entry -> (package->manifest-entry %bootstrap-guile))
(guile (package->derivation %bootstrap-guile)) (guile (package->derivation %bootstrap-guile))
@ -168,7 +172,7 @@ (define glibc
(_ (built-derivations (list drv)))) (_ (built-derivations (list drv))))
(return (and (file-exists? (string-append bindir "/guile")) (return (and (file-exists? (string-append bindir "/guile"))
(string=? (dirname (readlink bindir)) (string=? (dirname (readlink bindir))
(derivation->output-path guile))))))) (derivation->output-path guile))))))
(test-end "profiles") (test-end "profiles")