summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-20 14:34:36 +0100
committerLudovic Courtès <ludo@gnu.org>2015-12-20 22:34:22 +0100
commitaa8e051532a144ce86c13169e08abdd554b9823e (patch)
tree6740a0e68aab1d99900ff2596e71345140a9d082 /tests
parent54b7f63a72f79797c4dd587c9c28706d7ca89dc7 (diff)
packages: Add 'package-transitive-native-search-paths'.
* guix/packages.scm (package-transitive-native-search-paths): New procedure. * tests/packages.scm ("package-transitive-native-search-paths"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/packages.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm
index b28ae0b662..6a2f4f06e1 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -29,6 +29,7 @@
#:use-module (guix hash)
#:use-module (guix derivations)
#:use-module (guix packages)
+ #:use-module (guix search-paths)
#:use-module (guix build-system)
#:use-module (guix build-system trivial)
#:use-module (guix build-system gnu)
@@ -504,6 +505,26 @@
(equal? x (collect (package-derivation %store b)))
(equal? x (collect (package-derivation %store c)))))))
+(test-assert "package-transitive-native-search-paths"
+ (let* ((sp (lambda (name)
+ (list (search-path-specification
+ (variable name)
+ (files '("foo/bar"))))))
+ (p0 (dummy-package "p0" (native-search-paths (sp "PATH0"))))
+ (p1 (dummy-package "p1" (native-search-paths (sp "PATH1"))))
+ (p2 (dummy-package "p2"
+ (native-search-paths (sp "PATH2"))
+ (inputs `(("p0" ,p0)))
+ (propagated-inputs `(("p1" ,p1)))))
+ (p3 (dummy-package "p3"
+ (native-search-paths (sp "PATH3"))
+ (native-inputs `(("p0" ,p0)))
+ (propagated-inputs `(("p2" ,p2))))))
+ (lset= string=?
+ '("PATH1" "PATH2" "PATH3")
+ (map search-path-specification-variable
+ (package-transitive-native-search-paths p3)))))
+
(test-assert "package-cross-derivation"
(let ((drv (package-cross-derivation %store (dummy-package "p")
"mips64el-linux-gnu")))