summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorSarthak Shah <shahsarthakw@gmail.com>2023-04-25 17:52:10 +0530
committerLudovic Courtès <ludo@gnu.org>2023-05-04 17:06:44 +0200
commitae11fcb84ac478dfa56d322ef08890645183a087 (patch)
tree5c6c5131278d1534037fee8a95a4faf9a11b3dbd /tests
parentb20b7e61a33e2a6647397de31daa59431bb8e18e (diff)
downloadguix-ae11fcb84ac478dfa56d322ef08890645183a087.tar.gz
transformations: Add '--with-configure-flag'.
* guix/transformations.scm (transform-package-configure-flag): New
procedure.
(%transformation-options, %transformation-options)
(show-transformation-options-help/detailed): Add it.
* tests/transformations.scm ("options->transformation,
with-configure-flag"): New test.
* doc/guix.texi (Package Transformation Options): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/transformations.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm
index 1fa2c0bba8..704818b9ed 100644
--- a/tests/transformations.scm
+++ b/tests/transformations.scm
@@ -33,7 +33,7 @@
   #:use-module ((guix gexp)
                 #:select (local-file? local-file-file
                           computed-file? computed-file-gexp
-                          gexp-input-thing))
+                          gexp-input-thing gexp->approximate-sexp))
   #:use-module (guix ui)
   #:use-module (guix utils)
   #:use-module (guix git)
@@ -408,6 +408,17 @@
                         (package-full-name grep))
               (package-arguments (package-replacement dep0))))))))
 
+(test-equal "options->transformation, with-configure-flag"
+  '(append '() '("--flag=42"))
+  (let* ((p   (dummy-package "foo"
+                (build-system gnu-build-system)))
+         (t   (options->transformation
+               '((with-configure-flag . "foo=--flag=42")))))
+    (let ((new (t p)))
+      (match (package-arguments new)
+        ((#:configure-flags flags)
+         (gexp->approximate-sexp flags))))))
+
 (test-assert "options->transformation, without-tests"
   (let* ((dep (dummy-package "dep"))
          (p   (dummy-package "foo"