aboutsummaryrefslogtreecommitdiff
path: root/tests/modules.scm
blob: e70d2d9e0806bda2e43bba9a76eb509589afab3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (test-modules)
  #:use-module (guix modules)
  #:use-module ((guix build-system gnu) #:select (%gnu-build-system-modules))
  #:use-module ((guix utils) #:select (call-with-temporary-directory))
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-34)
  #:use-module (srfi srfi-64))

(test-begin "modules")

(test-assert "closure of (guix build gnu-build-system)"
  (lset= equal?
         (live-module-closure '((guix build gnu-build-system)))
         (source-module-closure '((guix build gnu-build-system)))
         %gnu-build-system-modules
         (source-module-closure %gnu-build-system-modules)
         (live-module-closure %gnu-build-system-modules)))

(test-assert "closure of (gnu build install)"
  (lset= equal?
         (live-module-closure '((gnu build install)))
         (source-module-closure '((gnu build install)))))

(test-assert "closure of (gnu build image)"
  (lset= equal?
         (live-module-closure '((gnu build image)))
         (source-module-closure '((gnu build image)))))

(test-equal "&missing-dependency-error"
  '(something that does not exist)
  (call-with-temporary-directory
   (lambda (directory)
     (call-with-output-file (string-append directory "/foobar.scm")
       (lambda (port)
         (write '(define-module (foobar)
                   #:use-module (something that does not exist))
                port)))

     (call-with-output-file (string-append directory "/baz.scm")
       (lambda (port)
         (write '(define-module (baz)
                   #:use-module (foobar))
                port)))

     (guard (c ((missing-dependency-error? c)
                (missing-dependency-module c)))
       (source-module-closure '((baz)) (list directory)
                              #:select? (const #t))))))

(test-end)
='/guix/commit/gnu/packages/autotools.scm?id=01c7193e0b0abe0b99c667ea6e8f0cfe17f9bcca'>gnu: automake: Update to 1.15.1.Efraim Flashner 2017-10-19gnu: automake: Use 'modify-phases'.Efraim Flashner 2017-10-02gnu: autoconf-archive: Update to 2017.09.28.Efraim Flashner 2017-07-30gnu: automake: Add 1.15.1.Ludovic Courtès 2017-04-21gnu: Add autoconf@2.13.Mark H Weaver 2017-03-30Merge branch 'master' into core-updatesMarius Bakke 2017-03-30gnu: Use HTTPS for almost all gnu.org HOME-PAGEs.Tobias Geerinckx-Rice 2017-03-23Merge remote-tracking branch 'origin/master' into core-updatesEfraim Flashner 2017-03-22gnu: autoconf-archive: Update to 2017.03.21.Efraim Flashner 2017-01-05gnu: libtool: Correct replacement shebang.Leo Famulari 2017-01-05gnu: libtool: Make sure all phases return a successful value.Leo Famulari 2017-01-05gnu: libtool: Don't replace 'sh' reference with 'bash'.Leo Famulari 2017-01-05gnu: libtool: Restore ltmain.sh shebang.ng0 2017-01-05gnu: libtool: Use 'modify-phases'.ng0 2016-09-18gnu: autoconf-archive: Update to 2016.09.16.Efraim Flashner 2016-06-14gnu: automake: Adjust test to ignore new gzip warnings.Ludovic Courtès 2016-05-26gnu: Add autoconf-archive.David Thompson 2016-04-14gnu: packages: Use 'search-patches' everywhere.Alex Kost 2016-01-15gnu: automake: Adjust to deal with Perl 5.22.Ludovic Courtès 2015-10-04gnu: Add autobuild.Mathieu Lirzin 2015-06-11packages: Make 'location' field innate.Ludovic Courtès 2015-04-21gnu: libltdl: Remove unneeded patch.Ludovic Courtès 2015-04-10gnu: libtool: Leave out the test suite workarounds.Ludovic Courtès