aboutsummaryrefslogtreecommitdiff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-30 12:17:33 +0200
committerMarius Bakke <mbakke@fastmail.com>2020-03-30 12:17:33 +0200
commitae0badf5bb791428423a98d4e4e2b8d297a5d4be (patch)
tree4282d243db3e90839a5f7d3b5878674ccd0e2e14 /tests/store.scm
parentee401ed9249fbe284ef1b9b437d39207ca88131b (diff)
parent927f3655662b41f25225ea03baa3ded687aa7cbb (diff)
downloadguix-ae0badf5bb791428423a98d4e4e2b8d297a5d4be.tar
guix-ae0badf5bb791428423a98d4e4e2b8d297a5d4be.tar.gz
Merge branch 'master' into core-updates
Conflicts: gnu/packages/admin.scm gnu/packages/commencement.scm gnu/packages/guile.scm gnu/packages/linux.scm gnu/packages/package-management.scm gnu/packages/pulseaudio.scm gnu/packages/web.scm
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm
index b61a981b28..0458a34746 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -412,6 +412,42 @@
(build-derivations %store (list d2))
'fail)))
+(test-assert "map/accumulate-builds"
+ (let* ((b (add-text-to-store %store "build" "echo $foo > $out" '()))
+ (s (add-to-store %store "bash" #t "sha256"
+ (search-bootstrap-binary "bash"
+ (%current-system))))
+ (d1 (derivation %store "the-thing"
+ s `("-e" ,b)
+ #:env-vars `(("foo" . ,(random-text)))
+ #:sources (list b s)))
+ (d2 (derivation %store "the-thing"
+ s `("-e" ,b)
+ #:env-vars `(("foo" . ,(random-text))
+ ("bar" . "baz"))
+ #:sources (list b s))))
+ (with-build-handler (lambda (continue store things mode)
+ (equal? (map derivation-file-name (list d1 d2))
+ things))
+ (map/accumulate-builds %store
+ (lambda (drv)
+ (build-derivations %store (list drv))
+ (add-to-store %store "content-addressed"
+ #t "sha256"
+ (derivation->output-path drv)))
+ (list d1 d2)))))
+
+(test-assert "mapm/accumulate-builds"
+ (let* ((d1 (run-with-store %store
+ (gexp->derivation "foo" #~(mkdir #$output))))
+ (d2 (run-with-store %store
+ (gexp->derivation "bar" #~(mkdir #$output)))))
+ (with-build-handler (lambda (continue store things mode)
+ (equal? (map derivation-file-name (pk 'zz (list d1 d2)))
+ (pk 'XX things)))
+ (run-with-store %store
+ (mapm/accumulate-builds built-derivations `((,d1) (,d2)))))))
+
(test-assert "topologically-sorted, one item"
(let* ((a (add-text-to-store %store "a" "a"))
(b (add-text-to-store %store "b" "b" (list a)))