aboutsummaryrefslogtreecommitdiff
path: root/tests/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-01-23 22:33:10 +0100
committerLudovic Courtès <ludo@gnu.org>2017-01-23 22:33:10 +0100
commit58ea4d407c2e4adbe51b2d7b71dc8bef095677c7 (patch)
tree0fd70c0cb82d7980a7ff82500dec7bfd0d535d3f /tests/store.scm
parentfcd75bdbfa99d14363b905afbf914eec20e69df8 (diff)
parent84b60a7cdfca1421a478894e279104a0c18a7c6d (diff)
downloadpatches-58ea4d407c2e4adbe51b2d7b71dc8bef095677c7.tar
patches-58ea4d407c2e4adbe51b2d7b71dc8bef095677c7.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm27
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/store.scm b/tests/store.scm
index 123ea8a787..983766d862 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -948,4 +948,29 @@
(string=? (derivation-file-name d)
(path-info-deriver (query-path-info %store o))))))
+(test-equal "build-cores"
+ (list 0 42)
+ (with-store store
+ (let* ((build (add-text-to-store store "build.sh"
+ "echo $NIX_BUILD_CORES > $out"))
+ (bash (add-to-store store "bash" #t "sha256"
+ (search-bootstrap-binary "bash"
+ (%current-system))))
+ (drv1 (derivation store "the-thing" bash
+ `("-e" ,build)
+ #:inputs `((,bash) (,build))
+ #:env-vars `(("x" . ,(random-text)))))
+ (drv2 (derivation store "the-thing" bash
+ `("-e" ,build)
+ #:inputs `((,bash) (,build))
+ #:env-vars `(("x" . ,(random-text))))))
+ (and (build-derivations store (list drv1))
+ (begin
+ (set-build-options store #:build-cores 42)
+ (build-derivations store (list drv2)))
+ (list (call-with-input-file (derivation->output-path drv1)
+ read)
+ (call-with-input-file (derivation->output-path drv2)
+ read))))))
+
(test-end "store")