summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-20 18:14:55 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-20 18:29:26 +0200
commit969e678ed9f907764e6412386432dfbddf493f71 (patch)
tree1e03fb0df41eb9d278dd4d75cc57fdf34c79327e /tests
parentd8482ad0d613758b85fdff90c5d6d6d2785564bf (diff)
downloadguix-969e678ed9f907764e6412386432dfbddf493f71.tar.gz
Add `--max-silent-time' to `guix build' and `guix package'.
* guix/scripts/build.scm (%default-options): Add default
  `max-silent-time' value.
  (show-help, %options):  Add `--max-silent-time'.
  (guix-build): Pass `max-silent-time' to `set-build-options'.
* guix/scripts/package.scm (%default-options): Add default
  `max-silent-time' value.
  (show-help, %options):  Add `--max-silent-time'.
  (guix-package): Pass `max-silent-time' to `set-build-options'.
* guix/ui.scm (string->number*): New procedure.
* tests/derivations.scm ("build-expression->derivation and
  max-silent-time"): New test.
* doc/guix.texi (Invoking guix package, Invoking guix build): Document
  `--max-silent-time'.
Diffstat (limited to 'tests')
-rw-r--r--tests/derivations.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index a50c1af878..0cba98e1e8 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -353,6 +353,21 @@
            (equal? '(hello guix)
                    (call-with-input-file (string-append p "/test") read))))))
 
+(test-assert "build-expression->derivation and max-silent-time"
+  (let* ((store      (let ((s (open-connection)))
+                       (set-build-options s #:max-silent-time 1)
+                       s))
+         (builder    '(sleep 100))
+         (drv-path   (build-expression->derivation %store "silent"
+                                                   (%current-system)
+                                                   builder '()))
+         (out-path   (derivation-path->output-path drv-path)))
+    (guard (c ((nix-protocol-error? c)
+               (and (string-contains (nix-protocol-error-message c)
+                                     "failed")
+                    (not (valid-path? store out-path)))))
+      (build-derivations %store (list drv-path)))))
+
 (test-assert "build-expression->derivation and derivation-prerequisites-to-build"
   (let-values (((drv-path drv)
                 (build-expression->derivation %store "fail" (%current-system)