diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-02-13 22:35:05 +0100 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-02-13 22:35:05 +0100 |
commit | 424b1ae76901c538457bd3c30d9d9cf67e79855f (patch) | |
tree | acc35c1160625618cd6083e728c6a4ff7e9cccc9 /tests/store.scm | |
parent | a50e03014177d2f00b5b85d3e1c295406f842016 (diff) | |
parent | eae2dbd47ac1f4a201b8584e2f88c30cd28e093a (diff) | |
download | guix-424b1ae76901c538457bd3c30d9d9cf67e79855f.tar guix-424b1ae76901c538457bd3c30d9d9cf67e79855f.tar.gz |
Merge branch 'master' into python-tests
Diffstat (limited to 'tests/store.scm')
-rw-r--r-- | tests/store.scm | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/store.scm b/tests/store.scm index 123ea8a787..64d3553f25 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. ;;; @@ -92,6 +92,11 @@ (test-skip (if %store 0 13)) +(test-equal "add-data-to-store" + #vu8(1 2 3 4 5) + (call-with-input-file (add-data-to-store %store "data" #vu8(1 2 3 4 5)) + get-bytevector-all)) + (test-assert "valid-path? live" (let ((p (add-text-to-store %store "hello" "hello, world"))) (valid-path? %store p))) @@ -948,4 +953,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") |