From 26bbbb95200b4fcd16bf92ee2593fccd9fe8f32d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 1 Jun 2012 23:29:55 +0200 Subject: First stab at the `derivation' primitive. * guix/store.scm (%store-prefix): New parameter. (store-path?, derivation-path?): New procedures. * guix/derivations.scm (write-derivation): Pass SOURCES through `object->string'. (compressed-hash, store-path, output-path, derivation): New procedures. * tests/derivations.scm (%store): New global variable. ("derivation with no inputs"): New test. --- tests/derivations.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/derivations.scm') diff --git a/tests/derivations.scm b/tests/derivations.scm index 21ec612ee6..c3aba3f12b 100644 --- a/tests/derivations.scm +++ b/tests/derivations.scm @@ -19,10 +19,14 @@ (define-module (test-derivations) #:use-module (guix derivations) + #:use-module (guix store) #:use-module (srfi srfi-26) #:use-module (srfi srfi-64) #:use-module (rnrs io ports)) +(define %store + (false-if-exception (open-connection))) + (test-begin "derivations") (test-assert "parse & export" @@ -33,6 +37,15 @@ (and (equal? b1 b2) (equal? d1 d2)))) +(test-skip (if %store 0 1)) + +(test-assert "derivation with no inputs" + (let ((builder (add-text-to-store %store "my-builder.sh" + "#!/bin/sh\necho hello, world\n" + '()))) + (store-path? (derivation %store "foo" "x86_64-linux" builder + '() '(("HOME" . "/homeless")) '())))) + (test-end) -- cgit v1.2.3