From 122c87ead0452a3042f1d42db9986a41218732cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Thu, 26 Mar 2015 23:34:21 +0100 Subject: Fix remaining references to "substitute-binary". * nix/nix-daemon/guix-daemon.cc (main): Change substitute-binary to substitute. * po/guix/POTFILES.in: Likewise. * tests/guix-daemon.sh: Likewise. * tests/guix-system.sh: Likewise. --- tests/guix-daemon.sh | 4 ++-- tests/guix-system.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh index a73c9e22e3..87f17def12 100644 --- a/tests/guix-daemon.sh +++ b/tests/guix-daemon.sh @@ -17,7 +17,7 @@ # along with GNU Guix. If not, see . # -# Test the daemon and its interaction with 'guix substitute-binary'. +# Test the daemon and its interaction with 'guix substitute'. # set -e @@ -51,7 +51,7 @@ Deriver: $drv EOF # Remove the cached narinfo. -rm -f "$XDG_CACHE_HOME/guix/substitute-binary/$hash_part" +rm -f "$XDG_CACHE_HOME/guix/substitute/$hash_part" # Make sure we see the substitute. guile -c ' diff --git a/tests/guix-system.sh b/tests/guix-system.sh index 76e722fbc1..1b77d1a0db 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -17,7 +17,7 @@ # along with GNU Guix. If not, see . # -# Test the daemon and its interaction with 'guix substitute-binary'. +# Test the daemon and its interaction with 'guix substitute'. # set -e -- cgit v1.2.3 From d9ae938f2c950f3bf1896fb07189c3e28b4d8029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 28 Mar 2015 21:26:33 +0100 Subject: gexp: Add 'local-file'. * guix/gexp.scm (): New record type. (local-file): New procedure. (local-file-compiler): New compiler. (gexp->sexp) : Handle the case where 'lower' returns a file name. (text-file*): Update docstring.local-file doc * tests/gexp.scm ("one local file", "gexp->derivation, local-file"): New tests. * doc/guix.texi (G-Expressions): Mention local files early. Document 'local-file'. Update 'text-file*' documentation. --- tests/gexp.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests') 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) -- cgit v1.2.3 From 4e7b6b4838318ca127ae588a7a28c8608b0c8721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 31 Mar 2015 21:59:05 +0200 Subject: tests: Fix module name for 'lint'. * tests/lint.scm: Change module name to 'test-lint'. --- tests/lint.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/lint.scm b/tests/lint.scm index c0599224b7..2312b80934 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -18,8 +18,7 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . - -(define-module (test-packages) +(define-module (test-lint) #:use-module (guix tests) #:use-module (guix download) #:use-module (guix build-system gnu) -- cgit v1.2.3 From 15aa2c38429a5785ed08519c88ff89a0b7027f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 31 Mar 2015 22:10:08 +0200 Subject: Add (guix build gremlin). * guix/build/gremlin.scm, tests/gremlin.scm: New files. * Makefile.am (MODULES): Add guix/build/gremlin.scm. (SCM_TESTS): Add tests/gremlin.scm. --- tests/gremlin.scm | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 tests/gremlin.scm (limited to 'tests') diff --git a/tests/gremlin.scm b/tests/gremlin.scm new file mode 100644 index 0000000000..225a72ff9f --- /dev/null +++ b/tests/gremlin.scm @@ -0,0 +1,57 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (test-gremlin) + #:use-module (guix elf) + #:use-module (guix build utils) + #:use-module (guix build gremlin) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-64) + #:use-module (rnrs io ports) + #:use-module (ice-9 match)) + +(define %guile-executable + (match (command-line) + ((program . _) + (and (file-exists? program) (elf-file? program) + program)) + (_ + #f))) + +(define read-elf + (compose parse-elf get-bytevector-all)) + + +(test-begin "gremlin") + +(unless %guile-executable (test-skip 1)) +(test-assert "elf-dynamic-info-needed, executable" + (let* ((elf (call-with-input-file %guile-executable read-elf)) + (dyninfo (elf-dynamic-info elf))) + (or (not dyninfo) ;static executable + (lset<= string=? + (list (string-append "libguile-" (effective-version)) + "libgc" "libunistring" "libffi") + (map (lambda (lib) + (string-take lib (string-contains lib ".so"))) + (elf-dynamic-info-needed dyninfo)))))) + +(test-end "gremlin") + + +(exit (= (test-runner-fail-count (test-runner-current)) 0)) -- cgit v1.2.3