summaryrefslogtreecommitdiff
path: root/guix/tests.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/tests.scm')
-rw-r--r--guix/tests.scm14
1 files changed, 11 insertions, 3 deletions
diff --git a/guix/tests.scm b/guix/tests.scm
index 0896e842da..87e6cc2830 100644
--- a/guix/tests.scm
+++ b/guix/tests.scm
@@ -37,7 +37,8 @@
%substitute-directory
with-derivation-narinfo
with-derivation-substitute
- dummy-package))
+ dummy-package
+ dummy-origin))
;;; Commentary:
;;;
@@ -126,7 +127,7 @@ Deriver: ~a~%"
(define* (call-with-derivation-narinfo drv thunk
#:key (sha256 (make-bytevector 32 0)))
"Call THUNK in a context where fake substituter data, as read by 'guix
-substitute-binary', has been installed for DRV. SHA256 is the hash of the
+substitute', has been installed for DRV. SHA256 is the hash of the
expected output of DRV."
(let* ((output (derivation->output-path drv))
(dir (%substitute-directory))
@@ -178,7 +179,7 @@ CONTENTS."
(lambda ()
(let ((hash (call-with-input-file (string-append dir "/example.nar")
port-sha256)))
- ;; Create fake substituter data, to be read by `substitute-binary'.
+ ;; Create fake substituter data, to be read by 'guix substitute'.
(call-with-derivation-narinfo drv
thunk
#:sha256 (or sha256 hash))))
@@ -219,6 +220,13 @@ initialized with default values, and with EXTRA-FIELDS set as specified."
(synopsis #f) (description #f)
(home-page #f) (license #f)))
+(define-syntax-rule (dummy-origin extra-fields ...)
+ "Return a \"dummy\" origin, with all its compulsory fields initialized with
+default values, and with EXTRA-FIELDS set as specified."
+ (origin extra-fields ...
+ (method #f) (uri "http://www.example.com")
+ (sha256 (base32 (make-string 52 #\x)))))
+
;; Local Variables:
;; eval: (put 'call-with-derivation-narinfo 'scheme-indent-function 1)
;; eval: (put 'call-with-derivation-substitute 'scheme-indent-function 2)