diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2012-07-01 00:21:16 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2012-07-01 00:27:27 +0200 |
| commit | 31ef99a8a590cc52cea0cfda3d45651504bf1cb9 (patch) | |
| tree | 0d34bf028b1898594ce29b9df2689118232e0f3f /tests/builders.scm | |
| parent | e036c31bc607ec1be8037294bdfd90723f3458a8 (diff) | |
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.scm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/builders.scm b/tests/builders.scm index 17bae2c7548..762944ba73a 100644 --- a/tests/builders.scm +++ b/tests/builders.scm | |||
| @@ -38,9 +38,11 @@ | |||
| 38 | (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz") | 38 | (let* ((url "http://ftp.gnu.org/gnu/hello/hello-2.8.tar.gz") |
| 39 | (hash (nix-base32-string->bytevector | 39 | (hash (nix-base32-string->bytevector |
| 40 | "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6")) | 40 | "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6")) |
| 41 | (drv-path (http-fetch %store url 'sha256 hash))) | 41 | (drv-path (http-fetch %store url 'sha256 hash)) |
| 42 | (out-path (derivation-path->output-path drv-path))) | ||
| 42 | (and (build-derivations %store (list drv-path)) | 43 | (and (build-derivations %store (list drv-path)) |
| 43 | (file-exists? (derivation-path->output-path drv-path))))) | 44 | (file-exists? out-path) |
| 45 | (valid-path? %store out-path)))) | ||
| 44 | 46 | ||
| 45 | (test-assert "gnu-build-system" | 47 | (test-assert "gnu-build-system" |
| 46 | (and (build-system? gnu-build-system) | 48 | (and (build-system? gnu-build-system) |
| @@ -52,10 +54,11 @@ | |||
| 52 | "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6")) | 54 | "0wqd8sjmxfskrflaxywc7gqw7sfawrfvdxd9skxawzfgyy0pzdz6")) |
| 53 | (tarball (http-fetch %store url 'sha256 hash)) | 55 | (tarball (http-fetch %store url 'sha256 hash)) |
| 54 | (build (gnu-build %store "hello-2.8" tarball | 56 | (build (gnu-build %store "hello-2.8" tarball |
| 55 | `(("gawk" ,(nixpkgs-derivation "gawk")))))) | 57 | `(("gawk" ,(nixpkgs-derivation "gawk"))))) |
| 58 | (out (derivation-path->output-path build))) | ||
| 56 | (and (build-derivations %store (list (pk 'hello-drv build))) | 59 | (and (build-derivations %store (list (pk 'hello-drv build))) |
| 57 | (file-exists? (string-append (derivation-path->output-path build) | 60 | (valid-path? %store out) |
| 58 | "/bin/hello"))))) | 61 | (file-exists? (string-append out "/bin/hello"))))) |
| 59 | 62 | ||
| 60 | (test-end "builders") | 63 | (test-end "builders") |
| 61 | 64 | ||
