summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-02-09 21:11:00 +0100
committerMarius Bakke <mbakke@fastmail.com>2019-02-09 21:11:00 +0100
commitebbb7286b91e21cb26153e3d0a3ea8017cf16224 (patch)
treec41eccbe937b0541109cc3b2d45c372ebf826755 /tests
parentd41f63942b5df85223f5fae110253bc30869653b (diff)
parentaefa29123feaf4202010675eae0a563b3ee90cf1 (diff)
downloadpatches-ebbb7286b91e21cb26153e3d0a3ea8017cf16224.tar
patches-ebbb7286b91e21cb26153e3d0a3ea8017cf16224.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-package.sh7
-rw-r--r--tests/opam.scm4
-rw-r--r--tests/profiles.scm17
-rw-r--r--tests/store.scm13
4 files changed, 33 insertions, 8 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 7eeb4304d1..0d60481895 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
#
# This file is part of GNU Guix.
@@ -97,6 +97,11 @@ then false; else true; fi
if guix package --bootstrap -i "guile-bootstrap:does-not-exist" -p "$profile";
then false; else true; fi
+# Make sure we get an error when trying to remove something that's not
+# installed.
+if guix package --bootstrap -r something-not-installed -p "$profile";
+then false; else true; fi
+
# Check whether `--list-available' returns something sensible.
guix package -p "$profile" -A 'gui.*e' | grep guile
diff --git a/tests/opam.scm b/tests/opam.scm
index e0ec5ef3d4..e8c0d15198 100644
--- a/tests/opam.scm
+++ b/tests/opam.scm
@@ -192,6 +192,8 @@ url {
("{>= \"0.2.0\" | build}" . (condition-or
(condition-greater-or-equal
(condition-string "0.2.0"))
- (condition-var "build"))))))
+ (condition-var "build")))
+ ("{ = \"1.0+beta19\" }" . (condition-eq
+ (condition-string "1.0+beta19"))))))
(test-end "opam")
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 9a05030aff..eef93e24cf 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -93,10 +93,7 @@
(test-assert "manifest-matching-entries"
(let* ((e (list guile-2.0.9 guile-2.0.9:debug))
(m (manifest e)))
- (and (null? (manifest-matching-entries m
- (list (manifest-pattern
- (name "python")))))
- (equal? e
+ (and (equal? e
(manifest-matching-entries m
(list (manifest-pattern
(name "guile")
@@ -107,6 +104,15 @@
(name "guile")
(version "2.0.9"))))))))
+(test-assert "manifest-matching-entries, no match"
+ (let ((m (manifest (list guile-2.0.9)))
+ (p (manifest-pattern (name "python"))))
+ (guard (c ((unmatched-pattern-error? c)
+ (and (eq? p (unmatched-pattern-error-pattern c))
+ (eq? m (unmatched-pattern-error-manifest c)))))
+ (manifest-matching-entries m (list p))
+ #f)))
+
(test-assert "manifest-remove"
(let* ((m0 (manifest (list guile-2.0.9 guile-2.0.9:debug)))
(m1 (manifest-remove m0
@@ -165,8 +171,7 @@
(test-assert "manifest-transaction-effects"
(let* ((m0 (manifest (list guile-1.8.8)))
(t (manifest-transaction
- (install (list guile-2.0.9 glibc))
- (remove (list (manifest-pattern (name "coreutils")))))))
+ (install (list guile-2.0.9 glibc)))))
(let-values (((remove install upgrade downgrade)
(manifest-transaction-effects m0 t)))
(and (null? remove) (null? downgrade)
diff --git a/tests/store.scm b/tests/store.scm
index e28c0c5aaa..df66feaebb 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -917,6 +917,19 @@
(build-mode check))
#f))))))))
+(test-assert "build-succeeded trace in check mode"
+ (string-contains
+ (call-with-output-string
+ (lambda (port)
+ (let ((d (build-expression->derivation
+ %store "foo" '(mkdir (assoc-ref %outputs "out"))
+ #:guile-for-build
+ (package-derivation %store %bootstrap-guile))))
+ (build-derivations %store (list d))
+ (parameterize ((current-build-output-port port))
+ (build-derivations %store (list d) (build-mode check))))))
+ "@ build-succeeded"))
+
(test-assert "build multiple times"
(with-store store
;; Ask to build twice.