diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2018-11-26 22:14:11 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2018-11-28 10:39:58 +0100 |
| commit | 8856f409d13cd7376be4319b9f75df0692c009d6 (patch) | |
| tree | 74855d6b0c022dc1409b98301b799d93524e2a0d /tests | |
| parent | 01e7ca5410e45f63a39f16a6e8156f3e0898141a (diff) | |
derivations: Add properties.
* guix/derivations.scm (derivation): Add #:properties parameter.
[user+system-env-vars]: Honor it.
(derivation-properties): New procedure.
(build-expression->derivation): Add #:properties and pass it to
'derivation'.
* guix/gexp.scm (gexp->derivation): Likewise.
* tests/derivations.scm ("derivation-properties"): New test.
* tests/gexp.scm ("gexp->derivation properties"): New test.
* doc/guix.texi (Derivations, G-Expressions): Adjust accordingly.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/derivations.scm | 10 | ||||
| -rw-r--r-- | tests/gexp.scm | 10 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm index 159a6971b39..5f294c18278 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm | |||
| @@ -1132,6 +1132,16 @@ | |||
| 1132 | ((p2 . _) | 1132 | ((p2 . _) |
| 1133 | (string<? p1 p2))))))))))))) | 1133 | (string<? p1 p2))))))))))))) |
| 1134 | 1134 | ||
| 1135 | (test-equal "derivation-properties" | ||
| 1136 | (list '() '((type . test))) | ||
| 1137 | (let ((drv1 (build-expression->derivation %store "bar" | ||
| 1138 | '(mkdir %output))) | ||
| 1139 | (drv2 (build-expression->derivation %store "foo" | ||
| 1140 | '(mkdir %output) | ||
| 1141 | #:properties '((type . test))))) | ||
| 1142 | (list (derivation-properties drv1) | ||
| 1143 | (derivation-properties drv2)))) | ||
| 1144 | |||
| 1135 | (test-equal "map-derivation" | 1145 | (test-equal "map-derivation" |
| 1136 | "hello" | 1146 | "hello" |
| 1137 | (let* ((joke (package-derivation %store guile-1.8)) | 1147 | (let* ((joke (package-derivation %store guile-1.8)) |
diff --git a/tests/gexp.scm b/tests/gexp.scm index ab60bdab682..7ae9201c81e 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm | |||
| @@ -476,7 +476,15 @@ | |||
| 476 | (return (and (string=? (readlink (string-append out "/foo")) guile) | 476 | (return (and (string=? (readlink (string-append out "/foo")) guile) |
| 477 | (string=? (readlink out2) file) | 477 | (string=? (readlink out2) file) |
| 478 | (equal? refs (list (dirname (dirname guile)))) | 478 | (equal? refs (list (dirname (dirname guile)))) |
| 479 | (equal? refs2 (list file)))))) | 479 | (equal? refs2 (list file)) |
| 480 | (null? (derivation-properties drv)))))) | ||
| 481 | |||
| 482 | (test-assertm "gexp->derivation properties" | ||
| 483 | (mlet %store-monad ((drv (gexp->derivation "foo" | ||
| 484 | #~(mkdir #$output) | ||
| 485 | #:properties '((type . test))))) | ||
| 486 | (return (equal? '((type . test)) | ||
| 487 | (derivation-properties drv))))) | ||
| 480 | 488 | ||
| 481 | (test-assertm "gexp->derivation vs. grafts" | 489 | (test-assertm "gexp->derivation vs. grafts" |
| 482 | (mlet* %store-monad ((graft? (set-grafting #f)) | 490 | (mlet* %store-monad ((graft? (set-grafting #f)) |
