summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/gexp.scm7
-rw-r--r--tests/packages.scm30
-rw-r--r--tests/size.scm19
3 files changed, 46 insertions, 10 deletions
diff --git a/tests/gexp.scm b/tests/gexp.scm
index 5c9a4fc031..740d74620e 100644
--- a/tests/gexp.scm
+++ b/tests/gexp.scm
@@ -536,6 +536,9 @@
(guix build utils))))
(ok? (built-derivations (list drv)))
(guile-drv (package->derivation %bootstrap-guile))
+ (bash (interned-file (search-bootstrap-binary "bash"
+ (%current-system))
+ "bash" #:recursive? #t))
(g-one -> (derivation->output-path drv "one"))
(g-two -> (derivation->output-path drv "two"))
(g-guile -> (derivation->output-path drv)))
@@ -543,8 +546,10 @@
(equal? (call-with-input-file g-one read) (list one))
(equal? (call-with-input-file g-two read)
(list one (derivation->output-path two "chbouib")))
+
+ ;; Note: %BOOTSTRAP-GUILE depends on the bootstrap Bash.
(equal? (call-with-input-file g-guile read)
- (list (derivation->output-path guile-drv)))))))
+ (list (derivation->output-path guile-drv) bash))))))
(test-assertm "gexp->derivation #:allowed-references"
(mlet %store-monad ((drv (gexp->derivation "allowed-refs"
diff --git a/tests/packages.scm b/tests/packages.scm
index 511ad78b6c..3cb532df1a 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -118,10 +118,32 @@
(equal? `(("a" ,a)) (package-transitive-inputs c))
(equal? (package-propagated-inputs d)
(package-transitive-inputs d))
- (equal? `(("b" ,b) ("b/a" ,a) ("c" ,c)
- ("d" ,d) ("d/x" "something.drv"))
+ (equal? `(("b" ,b) ("c" ,c) ("d" ,d)
+ ("a" ,a) ("x" "something.drv"))
(pk 'x (package-transitive-inputs e))))))
+(test-assert "package-transitive-inputs, no duplicates"
+ (let* ((a (dummy-package "a"))
+ (b (dummy-package "b"
+ (inputs `(("a+" ,a)))
+ (native-inputs `(("a*" ,a)))
+ (propagated-inputs `(("a" ,a)))))
+ (c (dummy-package "c"
+ (propagated-inputs `(("b" ,b)))))
+ (d (dummy-package "d"
+ (inputs `(("a" ,a) ("c" ,c)))))
+ (e (dummy-package "e"
+ (inputs `(("b" ,b) ("c" ,c))))))
+ (and (null? (package-transitive-inputs a))
+ (equal? `(("a*" ,a) ("a+" ,a) ("a" ,a)) ;here duplicates are kept
+ (package-transitive-inputs b))
+ (equal? `(("b" ,b) ("a" ,a))
+ (package-transitive-inputs c))
+ (equal? `(("a" ,a) ("c" ,c) ("b" ,b)) ;duplicate A removed
+ (package-transitive-inputs d))
+ (equal? `(("b" ,b) ("c" ,c) ("a" ,a))
+ (package-transitive-inputs e))))) ;ditto
+
(test-equal "package-transitive-supported-systems"
'(("x" "y" "z") ;a
("x" "y") ;b
@@ -573,8 +595,8 @@
(dummy (dummy-package "dummy"
(inputs `(("prop" ,prop)))))
(inputs (bag-transitive-inputs (package->bag dummy #:graft? #f))))
- (match (assoc "prop/dep" inputs)
- (("prop/dep" package)
+ (match (assoc "dep" inputs)
+ (("dep" package)
(eq? package dep)))))
(test-assert "bag->derivation"
diff --git a/tests/size.scm b/tests/size.scm
index 95b99a88ef..a1106045f8 100644
--- a/tests/size.scm
+++ b/tests/size.scm
@@ -24,6 +24,7 @@
#:use-module (guix gexp)
#:use-module (guix tests)
#:use-module (guix scripts size)
+ #:use-module (gnu packages)
#:use-module (gnu packages bootstrap)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
@@ -54,9 +55,15 @@
(built-derivations (list file2))
(mlet %store-monad ((profiles (store-profile
(derivation->output-path file2)))
+ (bash (interned-file
+ (search-bootstrap-binary
+ "bash" (%current-system)) "bash"
+ #:recursive? #t))
(guile (package->derivation %bootstrap-guile)))
- (define (lookup-profile drv)
- (find (matching-profile (derivation->output-path drv))
+ (define (lookup-profile item)
+ (find (matching-profile (if (derivation? item)
+ (derivation->output-path item)
+ item))
profiles))
(letrec-syntax ((match* (syntax-rules (=>)
@@ -67,15 +74,17 @@
((_ () body)
body))))
;; Make sure we get all three profiles with sensible values.
- (return (and (= (length profiles) 3)
+ (return (and (= (length profiles) 4)
(match* ((file1 => profile1)
(file2 => profile2)
- (guile => profile3))
+ (guile => profile3)
+ (bash => profile4)) ;dependency of GUILE
(and (> (profile-closure-size profile2) 0)
(= (profile-closure-size profile2)
(+ (profile-self-size profile1)
(profile-self-size profile2)
- (profile-self-size profile3))))))))))))
+ (profile-self-size profile3)
+ (profile-self-size profile4))))))))))))
(test-end "size")