diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-03-31 22:41:54 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-03-31 22:41:54 +0200 |
commit | 023dd28a303961cbf2848f13d3156c162d5e76c0 (patch) | |
tree | 2464aa01885d2a9f0c52fe893ce0afc8adff6ee7 /tests/gexp.scm | |
parent | a06af9f5284f7b5b649f5dc32131de18115ec92e (diff) | |
parent | 15aa2c38429a5785ed08519c88ff89a0b7027f0f (diff) | |
download | guix-023dd28a303961cbf2848f13d3156c162d5e76c0.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'tests/gexp.scm')
-rw-r--r-- | tests/gexp.scm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm index 0540969503..f81ef39860 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -97,6 +97,18 @@ %store (package-source coreutils)))) (gexp->sexp* exp))))) +(test-assert "one local file" + (let* ((file (search-path %load-path "guix.scm")) + (local (local-file file)) + (exp (gexp (display (ungexp local)))) + (intd (add-to-store %store (basename file) #t + "sha256" file))) + (and (gexp? exp) + (match (gexp-inputs exp) + (((x "out")) + (eq? x local))) + (equal? `(display ,intd) (gexp->sexp* exp))))) + (test-assert "same input twice" (let ((exp (gexp (begin (display (ungexp coreutils)) @@ -336,6 +348,20 @@ (mlet %store-monad ((drv mdrv)) (return (string=? system (derivation-system drv)))))) +(test-assertm "gexp->derivation, local-file" + (mlet* %store-monad ((file -> (search-path %load-path "guix.scm")) + (intd (interned-file file)) + (local -> (local-file file)) + (exp -> (gexp (begin + (stat (ungexp local)) + (symlink (ungexp local) + (ungexp output))))) + (drv (gexp->derivation "local-file" exp))) + (mbegin %store-monad + (built-derivations (list drv)) + (return (string=? (readlink (derivation->output-path drv)) + intd))))) + (test-assertm "gexp->derivation, cross-compilation" (mlet* %store-monad ((target -> "mips64el-linux") (exp -> (gexp (list (ungexp coreutils) |