summaryrefslogtreecommitdiff
path: root/tests/transformations.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-01-13 23:39:52 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2021-01-13 23:45:53 -0500
commit01f0707207741ce2a5d7509a175464799b08aea6 (patch)
tree08e8f4da56f26363c3b53e0442a21b286b55e0e5 /tests/transformations.scm
parent734bcf13139119daf8685f93b056c3422dbfa264 (diff)
parent6985a1acb3e9cc4cad8b6f63d77154842d25c929 (diff)
Merge branch 'staging' into 'core-updates'.
Conflicts: gnu/local.mk gnu/packages/cmake.scm gnu/packages/curl.scm gnu/packages/gl.scm gnu/packages/glib.scm gnu/packages/guile.scm gnu/packages/node.scm gnu/packages/openldap.scm gnu/packages/package-management.scm gnu/packages/python-xyz.scm gnu/packages/python.scm gnu/packages/tls.scm gnu/packages/vpn.scm gnu/packages/xorg.scm
Diffstat (limited to 'tests/transformations.scm')
-rw-r--r--tests/transformations.scm31
1 files changed, 27 insertions, 4 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm
index 07ed8b1234..9053deba41 100644
--- a/tests/transformations.scm
+++ b/tests/transformations.scm
@@ -26,6 +26,7 @@
#:use-module (guix build-system)
#:use-module (guix build-system gnu)
#:use-module (guix transformations)
+ #:use-module ((guix gexp) #:select (local-file? local-file-file))
#:use-module (guix ui)
#:use-module (guix utils)
#:use-module (guix git)
@@ -368,10 +369,32 @@
(let ((new (t p)))
(match (bag-direct-inputs (package->bag new))
((("dep" dep) ("tar" tar) _ ...)
- ;; TODO: Check whether TAR has #:tests? #f when transformations
- ;; apply to implicit inputs.
- (equal? (package-arguments dep)
- '(#:tests? #f)))))))
+ (and (equal? (package-arguments dep) '(#:tests? #f))
+ (match (memq #:tests? (package-arguments tar))
+ ((#:tests? #f _ ...) #t))))))))
+
+(test-equal "options->transformation, with-patch"
+ (search-patches "glibc-locales.patch" "guile-relocatable.patch")
+ (let* ((dep (dummy-package "dep"
+ (source (dummy-origin))))
+ (p (dummy-package "foo"
+ (inputs `(("dep" ,dep)))))
+ (patch1 (search-patch "glibc-locales.patch"))
+ (patch2 (search-patch "guile-relocatable.patch"))
+ (t (options->transformation
+ `((with-patch . ,(string-append "dep=" patch1))
+ (with-patch . ,(string-append "dep=" patch2))
+ (with-patch . ,(string-append "tar=" patch1))))))
+ (let ((new (t p)))
+ (match (bag-direct-inputs (package->bag new))
+ ((("dep" dep) ("tar" tar) _ ...)
+ (and (member patch1
+ (filter-map (lambda (patch)
+ (and (local-file? patch)
+ (local-file-file patch)))
+ (origin-patches (package-source tar))))
+ (map local-file-file
+ (origin-patches (package-source dep)))))))))
(test-end)