guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: tests: Use 'test-assertm' for profiles.


From: Ludovic Courtès
Subject: 01/02: tests: Use 'test-assertm' for profiles.
Date: Mon, 15 Dec 2014 22:02:14 +0000

civodul pushed a commit to branch master
in repository guix.

commit ebf5ad46db38fdf683b1b474faf610f4de2f65f9
Author: Ludovic Courtès <address@hidden>
Date:   Mon Dec 15 22:47:55 2014 +0100

    tests: Use 'test-assertm' for profiles.
    
    * tests/profiles.scm (test-assertm): New macro.
      ("profile-derivation"): Use it instead of 'test-assert' +
      'run-with-store'.
---
 tests/profiles.scm |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/tests/profiles.scm b/tests/profiles.scm
index 61c801c..d816248 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -35,6 +35,11 @@
 (define %store
   (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.
 
 (define guile-1.8.8
@@ -156,19 +161,18 @@
            (equal? (list glibc) install)
            (equal? (list (cons guile-1.8.8 guile-2.0.9)) upgrade)))))
 
-(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))
-                                         #:info-dir? #f))
-         (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-assertm "profile-derivation"
+  (mlet* %store-monad
+      ((entry ->   (package->manifest-entry %bootstrap-guile))
+       (guile      (package->derivation %bootstrap-guile))
+       (drv        (profile-derivation (manifest (list entry))
+                                       #:info-dir? #f))
+       (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")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]