summaryrefslogtreecommitdiff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-05-14 16:53:42 +0200
committerLudovic Courtès <ludo@gnu.org>2020-05-14 17:21:27 +0200
commit80963744a242257921917df5a901dc343d3a93db (patch)
tree3adcc9e38387470f6dc153363833254015863301 /tests/store.scm
parentf52fbf7094c9c346d38ad469cc8d92d18387786e (diff)
downloadpatches-80963744a242257921917df5a901dc343d3a93db.tar
patches-80963744a242257921917df5a901dc343d3a93db.tar.gz
store: 'mapm/accumulate-builds' preserves '%current-target-system'.
Fixes <https://bugs.gnu.org/41182>. * guix/store.scm (mapm/accumulate-builds): Pass #:system and #:target to 'run-with-store'. * tests/store.scm ("mapm/accumulate-builds, %current-target-system"): New test. * tests/guix-pack.sh: Add 'guix pack -d --target' test.
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/store.scm b/tests/store.scm
index 0e80ccc239..0af099c1ad 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -475,6 +475,23 @@
(run-with-store %store
(mapm/accumulate-builds built-derivations `((,d1) (,d2)))))))
+(test-equal "mapm/accumulate-builds, %current-target-system"
+ (make-list 2 '("i586-pc-gnu" "i586-pc-gnu"))
+ ;; Both the 'mapm' and 'mapm/accumulate-builds' procedures should see the
+ ;; right #:target.
+ (run-with-store %store
+ (mlet %store-monad ((lst1 (mapm %store-monad
+ (lambda _
+ (current-target-system))
+ '(a b)))
+ (lst2 (mapm/accumulate-builds
+ (lambda _
+ (current-target-system))
+ '(a b))))
+ (return (list lst1 lst2)))
+ #:system system
+ #:target "i586-pc-gnu"))
+
(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)))