summaryrefslogtreecommitdiff
path: root/tests/store.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/store.scm')
-rw-r--r--tests/store.scm31
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/store.scm b/tests/store.scm
index a3e67ac7ea4..87773bf0c36 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -1702,7 +1702,8 @@ System: x86_64-linux~%"
1702 (begin 1702 (begin
1703 (guard (c ((store-protocol-error? c) 1703 (guard (c ((store-protocol-error? c)
1704 (pk 'determinism-exception c) 1704 (pk 'determinism-exception c)
1705 (and (not (zero? (store-protocol-error-status c))) 1705 (and (valid-path? store file) ;must still be valid
1706 (not (zero? (store-protocol-error-status c)))
1706 (string-contains (store-protocol-error-message c) 1707 (string-contains (store-protocol-error-message c)
1707 "deterministic")))) 1708 "deterministic"))))
1708 ;; This one will produce a different result. Since we're in 1709 ;; This one will produce a different result. Since we're in
@@ -1711,6 +1712,34 @@ System: x86_64-linux~%"
1711 (build-mode check)) 1712 (build-mode check))
1712 #f)))))) 1713 #f))))))
1713 1714
1715(test-equal "build-things, check mode + keep-failed"
1716 '(#t #t)
1717 (with-store store
1718 (let* ((drv (build-expression->derivation
1719 store "deterministic-thing-to-check"
1720 `(let ((out (assoc-ref %outputs "out")))
1721 (call-with-output-file out
1722 (lambda (port)
1723 (display ,(let ((now (gettimeofday)))
1724 (+ (car now) (cdr now)))
1725 port))))
1726 #:guile-for-build
1727 (package-derivation
1728 store %bootstrap-guile (%current-system))))
1729 (file (derivation->output-path drv)))
1730 (and (build-things store (list (derivation-file-name drv)))
1731 (valid-path? store file)
1732 (begin
1733 ;; This would trigger accidental deletion of FILE.
1734 (set-build-options store
1735 #:keep-failed? #t
1736 #:keep-going? #t
1737 #:rounds 3)
1738 (build-things store (list (derivation-file-name drv))
1739 (build-mode check))
1740 (list (valid-path? store file)
1741 (file-exists? file)))))))
1742
1714(test-assert "build-succeeded trace in check mode" 1743(test-assert "build-succeeded trace in check mode"
1715 (string-contains 1744 (string-contains
1716 (call-with-output-string 1745 (call-with-output-string