[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/06: tests: Add 'test-assertm' to (guix tests).
From: |
Ludovic Courtès |
Subject: |
05/06: tests: Add 'test-assertm' to (guix tests). |
Date: |
Wed, 02 Sep 2015 21:39:52 +0000 |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit a4ada54bfdadab8b3d7710f5dd8f22b1f4276b73
Author: Ludovic Courtès <address@hidden>
Date: Sat Apr 4 21:59:25 2015 +0200
tests: Add 'test-assertm' to (guix tests).
* guix/tests.scm (test-assertm): New macro.
* tests/gexp.scm (test-assertm): Remove.
* tests/profiles.scm (test-assertm): Remove.
---
guix/tests.scm | 10 ++++++++++
tests/gexp.scm | 5 -----
tests/profiles.scm | 5 -----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/guix/tests.scm b/guix/tests.scm
index cd8eda2..09c490c 100644
--- a/guix/tests.scm
+++ b/guix/tests.scm
@@ -26,6 +26,7 @@
#:use-module (guix build-system gnu)
#:use-module (gnu packages bootstrap)
#:use-module (srfi srfi-34)
+ #:use-module (srfi srfi-64)
#:use-module (rnrs bytevectors)
#:use-module (rnrs io ports)
#:use-module (web uri)
@@ -37,6 +38,7 @@
shebang-too-long?
mock
%test-substitute-urls
+ test-assertm
%substitute-directory
with-derivation-narinfo
with-derivation-substitute
@@ -126,6 +128,14 @@ given by REPLACEMENT."
(lambda () body ...)
(lambda () (module-set! m 'proc original)))))
+(define-syntax-rule (test-assertm name exp)
+ "Like 'test-assert', but EXP has a monadic value. A new connection to the
+store is opened."
+ (test-assert name
+ (with-store store
+ (run-with-store store exp
+ #:guile-for-build (%guile-for-build)))))
+
;;;
;;; Narinfo files, as used by the substituter.
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 492f3d6..3fdef00 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -54,11 +54,6 @@
#:target target)
#:guile-for-build (%guile-for-build)))
-(define-syntax-rule (test-assertm name exp)
- (test-assert name
- (run-with-store %store exp
- #:guile-for-build (%guile-for-build))))
-
(test-begin "gexp")
diff --git a/tests/profiles.scm b/tests/profiles.scm
index cc9a822..041a2f9 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -40,11 +40,6 @@
(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
- branch wip-build-systems-gexp created (now 5364e0e), Ludovic Courtès, 2015/09/02
- 01/06: gnu: bootstrap: Move 'use-modules' forms to the beginning of build expressions., Ludovic Courtès, 2015/09/02
- 03/06: gexp: Micro-optimize sexp serialization., Ludovic Courtès, 2015/09/02
- 04/06: monads: Micro-optimize 'foldm'., Ludovic Courtès, 2015/09/02
- 05/06: tests: Add 'test-assertm' to (guix tests).,
Ludovic Courtès <=
- 06/06: packages: Turn 'bag->derivation' into a monadic procedure., Ludovic Courtès, 2015/09/02
- 02/06: build-system: Rewrite using gexps., Ludovic Courtès, 2015/09/02