[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/16: tests: Add 'test-assertm' to (guix tests).
From: |
Ludovic Courtès |
Subject: |
04/16: tests: Add 'test-assertm' to (guix tests). |
Date: |
Wed, 28 Jun 2017 17:48:54 -0400 (EDT) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit 12f5ce6e7781209c0ed35b1d332ea400fb7cc1a2
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 | 20 ++++++++++++++++++++
tests/gexp.scm | 5 -----
tests/profiles.scm | 11 -----------
3 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/guix/tests.scm b/guix/tests.scm
index 34e3e0f..830268f 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 (ice-9 binary-ports)
#:use-module (web uri)
@@ -37,6 +38,8 @@
shebang-too-long?
mock
%test-substitute-urls
+ test-assertm
+ test-equalm
%substitute-directory
with-derivation-narinfo
with-derivation-substitute
@@ -126,6 +129,23 @@ given by REPLACEMENT."
(lambda () body ...)
(lambda () (module-set! m 'proc original)))))
+(define-syntax-rule (test-assertm name exp)
+ "Like 'test-assert', but EXP is 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)))))
+
+(define-syntax-rule (test-equalm name value exp)
+ "Like 'test-equal', but EXP is a monadic value. A new connection to the
+store is opened."
+ (test-equal name
+ value
+ (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 cf88a9d..6ceb35e 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -60,11 +60,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 0934227..a343a16 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -45,17 +45,6 @@
;; Globally disable grafts because they can trigger early builds.
(%graft? #f)
-(define-syntax-rule (test-assertm name exp)
- (test-assert name
- (run-with-store %store exp
- #:guile-for-build (%guile-for-build))))
-
-(define-syntax-rule (test-equalm name value exp)
- (test-equal name
- value
- (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 6ce5f33), Ludovic Courtès, 2017/06/28
- 08/16: packages: Simplify patch instantiation., Ludovic Courtès, 2017/06/28
- 03/16: gexp: Micro-optimize sexp serialization., Ludovic Courtès, 2017/06/28
- 04/16: tests: Add 'test-assertm' to (guix tests).,
Ludovic Courtès <=
- 13/16: utils: Memoize 'absolute-dirname'., Ludovic Courtès, 2017/06/28
- 12/16: gexp: 'local-file' calls 'canonicalize-path' only in rare cases., Ludovic Courtès, 2017/06/28
- 14/16: download: 'built-in-builders*' relies on the functional cache., Ludovic Courtès, 2017/06/28
- 01/16: gnu: bootstrap: Move 'use-modules' forms to the beginning of build expressions., Ludovic Courtès, 2017/06/28
- 15/16: store: Add 'GUIX_PROFILING' support for the object cache., Ludovic Courtès, 2017/06/28
- 09/16: Use 'mapm' instead of 'sequence' + 'map'., Ludovic Courtès, 2017/06/28
- 05/16: packages: Turn 'bag->derivation' into a monadic procedure., Ludovic Courtès, 2017/06/28
- 11/16: packages: Turn 'cache!' into a single-value-return cache., Ludovic Courtès, 2017/06/28
- 06/16: store: Add a functional object cache and use it in 'lower-object'., Ludovic Courtès, 2017/06/28
- 10/16: gexp: 'imported-files' takes file-like objects., Ludovic Courtès, 2017/06/28