summaryrefslogtreecommitdiff
path: root/tests/transformations.scm
diff options
context:
space:
mode:
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 2d33bed7ae8..9053deba415 100644
--- a/tests/transformations.scm
+++ b/tests/transformations.scm
@@ -26,6 +26,7 @@
26 #:use-module (guix build-system) 26 #:use-module (guix build-system)
27 #:use-module (guix build-system gnu) 27 #:use-module (guix build-system gnu)
28 #:use-module (guix transformations) 28 #:use-module (guix transformations)
29 #:use-module ((guix gexp) #:select (local-file? local-file-file))
29 #:use-module (guix ui) 30 #:use-module (guix ui)
30 #:use-module (guix utils) 31 #:use-module (guix utils)
31 #:use-module (guix git) 32 #:use-module (guix git)
@@ -372,6 +373,29 @@
372 (match (memq #:tests? (package-arguments tar)) 373 (match (memq #:tests? (package-arguments tar))
373 ((#:tests? #f _ ...) #t)))))))) 374 ((#:tests? #f _ ...) #t))))))))
374 375
376(test-equal "options->transformation, with-patch"
377 (search-patches "glibc-locales.patch" "guile-relocatable.patch")
378 (let* ((dep (dummy-package "dep"
379 (source (dummy-origin))))
380 (p (dummy-package "foo"
381 (inputs `(("dep" ,dep)))))
382 (patch1 (search-patch "glibc-locales.patch"))
383 (patch2 (search-patch "guile-relocatable.patch"))
384 (t (options->transformation
385 `((with-patch . ,(string-append "dep=" patch1))
386 (with-patch . ,(string-append "dep=" patch2))
387 (with-patch . ,(string-append "tar=" patch1))))))
388 (let ((new (t p)))
389 (match (bag-direct-inputs (package->bag new))
390 ((("dep" dep) ("tar" tar) _ ...)
391 (and (member patch1
392 (filter-map (lambda (patch)
393 (and (local-file? patch)
394 (local-file-file patch)))
395 (origin-patches (package-source tar))))
396 (map local-file-file
397 (origin-patches (package-source dep)))))))))
398
375(test-end) 399(test-end)
376 400
377;;; Local Variables: 401;;; Local Variables: