summaryrefslogtreecommitdiff
path: root/tests/builders.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-07-01 00:21:16 +0200
committerLudovic Courtès <ludo@gnu.org>2012-07-01 00:27:27 +0200
commit31ef99a8a590cc52cea0cfda3d45651504bf1cb9 (patch)
tree0d34bf028b1898594ce29b9df2689118232e0f3f /tests/builders.scm
parente036c31bc607ec1be8037294bdfd90723f3458a8 (diff)
downloadgnu-guix-31ef99a8a590cc52cea0cfda3d45651504bf1cb9.tar
gnu-guix-31ef99a8a590cc52cea0cfda3d45651504bf1cb9.tar.gz
Add the `valid-path?' RPC.
* guix/store.scm (valid-path?): New procedure. * tests/builders.scm ("http-fetch", "gnu-build"): Use it. * tests/derivations.scm ("add-to-store, flat", "add-to-store, recursive", "derivation with no inputs", "build derivation with 1 source", "build derivation with coreutils", "build-expression->derivation with expression returning #f"): Likewise.
Diffstat (limited to 'tests/builders.scm')
-rw-r--r--tests/builders.scm13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/builders.scm b/tests/builders.scm
index 17bae2c754..762944ba73 100644
--- a/tests/builders.scm
+++ b/tests/builders.scm
@@ -38,9 +38,11 @@
(let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz")
(hash (nix-base32-string->bytevector
"0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
- (drv-path (http-fetch %store url 'sha256 hash)))
+ (drv-path (http-fetch %store url 'sha256 hash))
+ (out-path (derivation-path->output-path drv-path)))
(and (build-derivations %store (list drv-path))
- (file-exists? (derivation-path->output-path drv-path)))))
+ (file-exists? out-path)
+ (valid-path? %store out-path))))
(test-assert "gnu-build-system"
(and (build-system? gnu-build-system)
@@ -52,10 +54,11 @@
"0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6"))
(tarball (http-fetch %store url 'sha256 hash))
(build (gnu-build %store "hello-2.8" tarball
- `(("gawk" ,(nixpkgs-derivation "gawk"))))))
+ `(("gawk" ,(nixpkgs-derivation "gawk")))))
+ (out (derivation-path->output-path build)))
(and (build-derivations %store (list (pk 'hello-drv build)))
- (file-exists? (string-append (derivation-path->output-path build)
- "/bin/hello")))))
+ (valid-path? %store out)
+ (file-exists? (string-append out "/bin/hello")))))
(test-end "builders")