summaryrefslogtreecommitdiff
path: root/tests/transformations.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2020-12-29 17:39:24 +0100
committerMarius Bakke <marius@gnu.org>2020-12-29 17:39:24 +0100
commit78cf7a4571081ff9c9e4ab678bf67368de1add59 (patch)
treed37341b9129f7ea1c6288f5095af2d046fb27710 /tests/transformations.scm
parentafa493c4c7ef307455b16b52a87d180f0c4a8c6b (diff)
parenta22e75c073c785a3a71c952d97fb7ab87dfd282d (diff)
Merge branch 'ungrafting' into staging
Diffstat (limited to 'tests/transformations.scm')
-rw-r--r--tests/transformations.scm24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm
index 2d33bed7ae..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)
@@ -372,6 +373,29 @@
(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)
;;; Local Variables: