diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-07-01 00:37:03 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-07-01 00:37:03 +0200 |
commit | 9a20830e57ea50dd73897725ad656a3b9e66f1ef (patch) | |
tree | cec6e88da4c3fff415562c30848e55c4bee934b3 /tests | |
parent | 31ef99a8a590cc52cea0cfda3d45651504bf1cb9 (diff) | |
download | patches-9a20830e57ea50dd73897725ad656a3b9e66f1ef.tar patches-9a20830e57ea50dd73897725ad656a3b9e66f1ef.tar.gz |
Add `derivation-prerequisites' and `derivation-prerequisites-to-build'.
* guix/derivations.scm (derivation-prerequisites,
derivation-prerequisites-to-build): New procedures.
* tests/derivations.scm ("build-expression->derivation and
derivation-prerequisites", "build-expression->derivation and
derivation-prerequisites-to-build"): New tests.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/derivations.scm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm index 3fc7097a87..b6bd4dab0d 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -172,7 +172,16 @@ (and (valid-path? %store p) (file-exists? (string-append p "/good"))))))) -(test-skip (if (%guile-for-build) 0 4)) +(test-skip (if (%guile-for-build) 0 6)) + +(test-assert "build-expression->derivation and derivation-prerequisites" + (let-values (((drv-path drv) + (build-expression->derivation %store "fail" (%current-system) + #f '()))) + (any (match-lambda + (($ <derivation-input> path) + (string=? path (%guile-for-build)))) + (derivation-prerequisites drv)))) (test-assert "build-expression->derivation without inputs" (let* ((builder '(begin @@ -188,6 +197,14 @@ (equal? '(hello guix) (call-with-input-file (string-append p "/test") read)))))) +(test-assert "build-expression->derivation and derivation-prerequisites-to-build" + (let-values (((drv-path drv) + (build-expression->derivation %store "fail" (%current-system) + #f '()))) + ;; The only direct dependency is (%guile-for-build) and it's already + ;; built. + (null? (derivation-prerequisites-to-build %store drv)))) + (test-assert "build-expression->derivation with expression returning #f" (let* ((builder '(begin (mkdir %output) |