summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/derivations.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/derivations.scm b/tests/derivations.scm
index b0d74ca50d1..a5e82238a48 100644
--- a/tests/derivations.scm
+++ b/tests/derivations.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2026 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2012-2026 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez@gmail.com>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -20,6 +21,7 @@
20 21
21(define-module (test-derivations) 22(define-module (test-derivations)
22 #:use-module (guix derivations) 23 #:use-module (guix derivations)
24 #:use-module (guix gexp)
23 #:use-module (guix store) 25 #:use-module (guix store)
24 #:use-module (guix utils) 26 #:use-module (guix utils)
25 #:use-module ((gcrypt hash) #:prefix gcrypt:) 27 #:use-module ((gcrypt hash) #:prefix gcrypt:)
@@ -1606,6 +1608,29 @@
1606 (and (build-derivations %store (list (pk 'remapped* drv2))) 1608 (and (build-derivations %store (list (pk 'remapped* drv2)))
1607 (call-with-input-file out get-string-all)))) 1609 (call-with-input-file out get-string-all))))
1608 1610
1611(test-assert "map-derivation, modules"
1612 (let* ((bash-drv (package-derivation %store (@ (gnu packages bash) bash)))
1613 (bash-input (car (derivation-inputs bash-drv)))
1614 (bash-input-drv (derivation-input-derivation bash-input))
1615 (drv-with-modules (run-with-store %store
1616 (gexp->derivation "derivation-with-modules"
1617 (with-imported-modules '((guix build utils))
1618 #~(begin
1619 (use-modules (guix build utils))
1620 (mkdir-p (string-append #$output
1621 "/bin")))))))
1622 (bash-mapped-1 (map-derivation %store bash-drv
1623 `((,bash-input-drv . ,drv-with-modules))))
1624 (bash-mapped-2 (map-derivation %store bash-mapped-1
1625 `((,drv-with-modules . ,bash-input-drv))))
1626 (is-input? (lambda (in drv)
1627 (not (null? (filter (lambda (input)
1628 (eq? in (derivation-input-derivation input)))
1629 (derivation-inputs drv)))))))
1630 (and
1631 (not (is-input? bash-input-drv bash-mapped-1))
1632 (is-input? bash-input-drv bash-mapped-2))))
1633
1609(test-end) 1634(test-end)
1610 1635
1611;; Local Variables: 1636;; Local Variables: