diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/derivations.scm | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm index 90738677930..29b341e2bb0 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm | |||
| @@ -562,7 +562,6 @@ | |||
| 562 | ;; prerequisite to build because DRV itself is already built. | 562 | ;; prerequisite to build because DRV itself is already built. |
| 563 | (null? (derivation-prerequisites-to-build %store drv))))) | 563 | (null? (derivation-prerequisites-to-build %store drv))))) |
| 564 | 564 | ||
| 565 | (test-skip (if (getenv "GUIX_BINARY_SUBSTITUTE_URL") 0 1)) | ||
| 566 | (test-assert "derivation-prerequisites-to-build and substitutes" | 565 | (test-assert "derivation-prerequisites-to-build and substitutes" |
| 567 | (let* ((store (open-connection)) | 566 | (let* ((store (open-connection)) |
| 568 | (drv (build-expression->derivation store "prereq-subst" | 567 | (drv (build-expression->derivation store "prereq-subst" |
| @@ -583,6 +582,30 @@ | |||
| 583 | (null? download*) | 582 | (null? download*) |
| 584 | (null? build*)))))) | 583 | (null? build*)))))) |
| 585 | 584 | ||
| 585 | (test-assert "derivation-prerequisites-to-build and substitutes, local build" | ||
| 586 | (let* ((store (open-connection)) | ||
| 587 | (drv (build-expression->derivation store "prereq-subst-local" | ||
| 588 | (random 1000) | ||
| 589 | ;; XXX: Adjust once | ||
| 590 | ;; <http://bugs.gnu.org/18747> | ||
| 591 | ;; is fixed. | ||
| 592 | #:local-build? #t)) | ||
| 593 | (output (derivation->output-path drv))) | ||
| 594 | |||
| 595 | ;; Make sure substitutes are usable. | ||
| 596 | (set-build-options store #:use-substitutes? #t) | ||
| 597 | |||
| 598 | (with-derivation-narinfo drv | ||
| 599 | (let-values (((build download) | ||
| 600 | (derivation-prerequisites-to-build store drv))) | ||
| 601 | ;; Despite being available as a substitute, DRV will be built locally | ||
| 602 | ;; due to #:local-build?. | ||
| 603 | (and (null? download) | ||
| 604 | (match build | ||
| 605 | (((? derivation-input? input)) | ||
| 606 | (string=? (derivation-input-path input) | ||
| 607 | (derivation-file-name drv))))))))) | ||
| 608 | |||
| 586 | (test-assert "build-expression->derivation with expression returning #f" | 609 | (test-assert "build-expression->derivation with expression returning #f" |
| 587 | (let* ((builder '(begin | 610 | (let* ((builder '(begin |
| 588 | (mkdir %output) | 611 | (mkdir %output) |
