summaryrefslogtreecommitdiff
path: root/tests/builders.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-11-12 23:10:26 +0100
committerLudovic Courtès <ludo@gnu.org>2012-11-12 23:35:04 +0100
commit62cab99c3297a066f466780bb4d83a4f142538c7 (patch)
treed17374f770ad043356b915967f8960ab9f8cc7c0 /tests/builders.scm
parentddc29a782eac30fcf4ff1f07677aa2896dc140e4 (diff)
downloadgnu-guix-62cab99c3297a066f466780bb4d83a4f142538c7.tar
gnu-guix-62cab99c3297a066f466780bb4d83a4f142538c7.tar.gz
Add (guix download) and (guix build download).
* guix/download.scm, guix/build/download.scm: New files. * Makefile.am (MODULES): Add them. * tests/builders.scm ("url-fetch"): New test. * distro/packages/bootstrap.scm (bootstrap-origin): Support `url-fetch'. * guix/snix.scm (snix-derivation->guix-package): Use `url-fetch' instead of `http-fetch'.
Diffstat (limited to 'tests/builders.scm')
-rw-r--r--tests/builders.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/builders.scm b/tests/builders.scm
index d9dc5afa20..9cc86ef1c2 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -19,6 +19,7 @@
(define-module (test-builders)
#:use-module (guix http)
+ #:use-module (guix download)
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
#:use-module (guix store)
@@ -63,6 +64,17 @@
(file-exists? out-path)
(valid-path? %store out-path))))
+(test-assert "url-fetch"
+ (let* ((url '("http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"
+ "ftp://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz"))
+ (hash (nix-base32-string->bytevector
+ "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
+ (drv-path (url-fetch %store url 'sha256 hash))
+ (out-path (derivation-path->output-path drv-path)))
+ (and (build-derivations %store (list drv-path))
+ (file-exists? out-path)
+ (valid-path? %store out-path))))
+
(test-assert "gnu-build-system"
(and (build-system? gnu-build-system)
(eq? gnu-build (build-system-builder gnu-build-system))))