diff options
| author | Huang Ying <huang.ying.caritas@gmail.com> | 2017-03-12 19:53:58 +0800 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-03-26 12:53:48 +0200 |
| commit | addce19e2d38a197f5ea10eefb5f3cd25c3a52e7 (patch) | |
| tree | 87f70b53d781a51da36f18f780bfdb586f94d26d /tests/union.scm | |
| parent | 7398d96ee9141768de2a33df94109f7f10637d27 (diff) | |
union: Add create-all-directories? parameter to 'union-build'.
* guix/build/union.scm (union-build): Add create-all-directories? keyword
parameter.
* tests/union.scm ("union-build #:create-all-directories? #t"): New test.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/union.scm')
| -rw-r--r-- | tests/union.scm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/union.scm b/tests/union.scm index cccf3971815..b63edc757b9 100644 --- a/tests/union.scm +++ b/tests/union.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; | 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 5 | ;;; |
| @@ -124,4 +124,24 @@ | |||
| 124 | ;; new 'bin' sub-directory in the profile. | 124 | ;; new 'bin' sub-directory in the profile. |
| 125 | (eq? 'directory (stat:type (lstat "bin")))))))) | 125 | (eq? 'directory (stat:type (lstat "bin")))))))) |
| 126 | 126 | ||
| 127 | (test-assert "union-build #:create-all-directories? #t" | ||
| 128 | (let* ((build `(begin | ||
| 129 | (use-modules (guix build union)) | ||
| 130 | (union-build (assoc-ref %outputs "out") | ||
| 131 | (map cdr %build-inputs) | ||
| 132 | #:create-all-directories? #t))) | ||
| 133 | (input (package-derivation %store %bootstrap-guile)) | ||
| 134 | (drv (build-expression->derivation %store "union-test-all-dirs" | ||
| 135 | build | ||
| 136 | #:modules '((guix build union)) | ||
| 137 | #:inputs `(("g" ,input))))) | ||
| 138 | (and (build-derivations %store (list drv)) | ||
| 139 | (with-directory-excursion (derivation->output-path drv) | ||
| 140 | ;; Even though there's only one input to the union, | ||
| 141 | ;; #:create-all-directories? #t must have created bin/ rather than | ||
| 142 | ;; making it a symlink to Guile's bin/. | ||
| 143 | (and (file-exists? "bin/guile") | ||
| 144 | (file-is-directory? "bin") | ||
| 145 | (eq? 'symlink (stat:type (lstat "bin/guile")))))))) | ||
| 146 | |||
| 127 | (test-end) | 147 | (test-end) |
