aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-06-06 14:01:12 +0200
committerLudovic Courtès <ludo@gnu.org>2017-06-21 11:05:52 +0200
commit55b4715fd4c03e46501f123c5c9bc6072edf12a4 (patch)
treec4a593e5449fc61491460136507ad81eec9d5163 /tests
parenta431929d3dadf2dd1e9ed95146c77edffc9ba22f (diff)
downloadguix-55b4715fd4c03e46501f123c5c9bc6072edf12a4.tar
guix-55b4715fd4c03e46501f123c5c9bc6072edf12a4.tar.gz
profiles: Represent propagated inputs as manifest entries.
* guix/profiles.scm (package->manifest-entry): Turn DEPS into a list of manifest entries. (manifest->gexp)[entry->gexp]: Call 'entry->gexp' on DEPS. Bump version to 3. (sexp->manifest)[infer-dependency]: New procedure. Use it for versions 1 and 2. Parse version 3. (manifest-inputs)[entry->gexp]: New procedure. Adjust to 'dependencies' being a list of <manifest-entry>. * tests/profiles.scm ("packages->manifest, propagated inputs") ("read-manifest"): New fields.
Diffstat (limited to 'tests')
-rw-r--r--tests/profiles.scm36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 093422792f..e8b1bb832c 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -288,6 +288,42 @@
(manifest-entry-search-paths
(package->manifest-entry mpl)))))
+(test-equal "packages->manifest, propagated inputs"
+ (map (match-lambda
+ ((label package)
+ (list (package-name package) (package-version package)
+ package)))
+ (package-propagated-inputs packages:guile-2.2))
+ (map (lambda (entry)
+ (list (manifest-entry-name entry)
+ (manifest-entry-version entry)
+ (manifest-entry-item entry)))
+ (manifest-entry-dependencies
+ (package->manifest-entry packages:guile-2.2))))
+
+(test-assertm "read-manifest"
+ (mlet* %store-monad ((manifest -> (packages->manifest
+ (list (package
+ (inherit %bootstrap-guile)
+ (native-search-paths
+ (package-native-search-paths
+ packages:guile-2.0))))))
+ (drv (profile-derivation manifest
+ #:hooks '()
+ #:locales? #f))
+ (out -> (derivation->output-path drv)))
+ (define (entry->sexp entry)
+ (list (manifest-entry-name entry)
+ (manifest-entry-version entry)
+ (manifest-entry-search-paths entry)
+ (manifest-entry-dependencies entry)))
+
+ (mbegin %store-monad
+ (built-derivations (list drv))
+ (let ((manifest2 (profile-manifest out)))
+ (return (equal? (map entry->sexp (manifest-entries manifest))
+ (map entry->sexp (manifest-entries manifest2))))))))
+
(test-assertm "etc/profile"
;; Make sure we get an 'etc/profile' file that at least defines $PATH.
(mlet* %store-monad