summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/build-utils.scm25
-rw-r--r--tests/guix-environment.sh23
-rw-r--r--tests/guix-pack.sh11
-rw-r--r--tests/guix-package.sh13
-rw-r--r--tests/profiles.scm5
-rw-r--r--tests/publish.scm1
-rw-r--r--tests/substitute.scm6
7 files changed, 66 insertions, 18 deletions
diff --git a/tests/build-utils.scm b/tests/build-utils.scm
index 61e6c44e63..47a57a984b 100644
--- a/tests/build-utils.scm
+++ b/tests/build-utils.scm
@@ -151,11 +151,12 @@ echo hello world"))
(test-equal "wrap-script, simple case"
(string-append
(format #f "\
-#!GUILE --no-auto-compile
+#!~a --no-auto-compile
#!#; Guix wrapper
#\\-~s
#\\-~s
"
+ (which "guile")
'(begin (let ((current (getenv "GUIX_FOO")))
(setenv "GUIX_FOO"
(if current
@@ -175,11 +176,9 @@ echo hello world"))
(lambda (port)
(format port script-contents)))
(chmod script-file-name #o777)
-
- (mock ((guix build utils) which (const "GUILE"))
- (wrap-script script-file-name
- `("GUIX_FOO" prefix ("/some/path"
- "/some/other/path"))))
+ (wrap-script script-file-name
+ `("GUIX_FOO" prefix ("/some/path"
+ "/some/other/path")))
(let ((str (call-with-input-file script-file-name get-string-all)))
(with-directory-excursion directory
(delete-file "foo"))
@@ -235,13 +234,11 @@ print('hello world')"))
(lambda (port)
(format port "This is not a script")))
(chmod script-file-name #o777)
- (catch 'srfi-34
- (lambda ()
- (wrap-script script-file-name
- #:guile "MYGUILE"
- `("GUIX_FOO" prefix ("/some/path"
- "/some/other/path"))))
- (lambda (type obj)
- (wrap-error? obj)))))))
+ (guard (c ((wrap-error? c) #t))
+ (wrap-script script-file-name
+ #:guile "MYGUILE"
+ `("GUIX_FOO" prefix ("/some/path"
+ "/some/other/path")))
+ #f)))))
(test-end)
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index fb1c1a022d..2faf38df06 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -84,6 +84,29 @@ echo "(use-modules (guix profiles) (gnu packages bootstrap))
guix environment --bootstrap --manifest=$tmpdir/manifest.scm --pure \
-- "$SHELL" -c 'test -f "$GUIX_ENVIRONMENT/bin/guile"'
+# Make sure '--manifest' can be specified multiple times.
+cat > "$tmpdir/manifest2.scm" <<EOF
+(use-modules (guix) (guix profiles)
+ (guix build-system trivial)
+ (gnu packages bootstrap))
+
+(packages->manifest
+ (list (package
+ (inherit %bootstrap-guile)
+ (name "eliug")
+ (build-system trivial-build-system)
+ (arguments
+ (quasiquote
+ (#:guile ,%bootstrap-guile
+ #:builder
+ (begin
+ (mkdir %output)
+ (mkdir (string-append %output "/eliug")))))))))
+EOF
+guix environment --bootstrap -m "$tmpdir/manifest.scm" \
+ -m "$tmpdir/manifest2.scm" --pure \
+ -- "$SHELL" -c 'test -f "$GUIX_ENVIRONMENT/bin/guile" && test -d "$GUIX_ENVIRONMENT/eliug"'
+
# Make sure '-r' works as expected.
rm -f "$gcroot"
expected="`guix environment --bootstrap --ad-hoc guile-bootstrap \
diff --git a/tests/guix-pack.sh b/tests/guix-pack.sh
index cf4e4ca4f9..7a0f3400c3 100644
--- a/tests/guix-pack.sh
+++ b/tests/guix-pack.sh
@@ -109,3 +109,14 @@ drv1="`guix pack -n guile 2>&1 | grep pack.*\.drv`"
drv2="`guix pack -n --with-source=guile=$test_directory guile 2>&1 | grep pack.*\.drv`"
test -n "$drv1"
test "$drv1" != "$drv2"
+
+# Try '--manifest' options.
+cat > "$test_directory/manifest1.scm" <<EOF
+(specifications->manifest '("guile"))
+EOF
+cat > "$test_directory/manifest2.scm" <<EOF
+(specifications->manifest '("emacs"))
+EOF
+drv="`guix pack -nd -m "$test_directory/manifest1.scm" -m "$test_directory/manifest2.scm"`"
+guix gc -R "$drv" | grep `guix build guile -nd`
+guix gc -R "$drv" | grep `guix build emacs -nd`
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 7ad0699380..6d081d58be 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -394,6 +394,19 @@ guix package -I | grep guile
test `guix package -I | wc -l` -eq 1
guix package --rollback --bootstrap
+# Applying two manifests.
+cat > "$module_dir/manifest2.scm"<<EOF
+(use-modules (gnu packages bootstrap) (guix))
+(define p (package (inherit %bootstrap-guile) (name "eliug")))
+(packages->manifest (list p))
+EOF
+guix package --bootstrap \
+ -m "$module_dir/manifest.scm" -m "$module_dir/manifest2.scm"
+guix package -I | grep guile
+guix package -I | grep eliug
+test `guix package -I | wc -l` -eq 2
+guix package --rollback --bootstrap
+
# Applying a manifest file with inferior packages.
cat > "$module_dir/manifest.scm"<<EOF
(use-modules (guix inferior))
diff --git a/tests/profiles.scm b/tests/profiles.scm
index a4e28672b5..21c912a532 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -113,6 +113,11 @@
(manifest-matching-entries m (list p))
#f)))
+(test-equal "concatenate-manifests"
+ (manifest (list guile-2.0.9 glibc))
+ (concatenate-manifests (list (manifest (list guile-2.0.9))
+ (manifest (list glibc)))))
+
(test-assert "manifest-remove"
(let* ((m0 (manifest (list guile-2.0.9 guile-2.0.9:debug)))
(m1 (manifest-remove m0
diff --git a/tests/publish.scm b/tests/publish.scm
index 64a8ff3cae..204cfb4974 100644
--- a/tests/publish.scm
+++ b/tests/publish.scm
@@ -45,6 +45,7 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-64)
+ #:use-module (ice-9 threads)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (ice-9 rdelim))
diff --git a/tests/substitute.scm b/tests/substitute.scm
index ff2be662be..a4246aff82 100644
--- a/tests/substitute.scm
+++ b/tests/substitute.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
-;;; Copyright © 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -169,9 +169,7 @@ a file for NARINFO."
(cute write-file
(string-append narinfo-directory "/example.out") <>))
- (set! (@@ (guix scripts substitute)
- %allow-unauthenticated-substitutes?)
- #f))
+ (%allow-unauthenticated-substitutes? #f))
thunk
(lambda ()
(when (file-exists? cache-directory)