1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (test-texlive)
20 #:use-module (gnu packages tex)
21 #:use-module (guix import texlive)
22 #:use-module (guix tests)
23 #:use-module (guix tests http)
24 #:use-module (guix build utils)
25 #:use-module (srfi srfi-1)
26 #:use-module (srfi srfi-64)
27 #:use-module (srfi srfi-26)
28 #:use-module (web client)
29 #:use-module (ice-9 match))
31 (test-begin "texlive")
37 <caption>Foomatic frobnication in LuaLaTeX</caption>
38 <authorref id=\"rekado\"/>
39 <license type=\"lppl1.3\"/>
40 <version number=\"2.6a\"/>
43 Foo is a package for LuaLaTeX. It provides an interface to frobnicate gimbals
44 in a foomatic way with the LuaTeX engine.
47 The package requires the bar and golly
48 bundles for extremely special specialties.
51 <ctan path=\"/macros/latex/contrib/foo\" file=\"true\"/>
52 <texlive location=\"foo\"/>
53 <keyval key=\"topic\" value=\"tests\"/>
58 '(*TOP* (entry (@ (id "foo"))
60 (caption "Foomatic frobnication in LuaLaTeX")
61 (authorref (@ (id "rekado")))
62 (license (@ (type "lppl1.3")))
63 (version (@ (number "2.6a")))
65 (p "\n Foo is a package for LuaLaTeX. It provides an interface to frobnicate gimbals\n in a foomatic way with the LuaTeX engine.\n ")
66 (p "\n The package requires the bar and golly\n bundles for extremely special specialties.\n "))
67 (ctan (@ (path "/macros/latex/contrib/foo") (file "true")))
68 (texlive (@ (location "foo")))
69 (keyval (@ (value "tests") (key "topic")))
72 ;; Avoid collisions with other tests.
73 (%http-server-port 10200)
75 (test-equal "fetch-sxml: returns SXML for valid XML"
77 (with-http-server `((200 ,xml))
78 (parameterize ((current-http-proxy (%local-url)))
82 (test-assert "sxml->package"
83 ;; Replace network resources with sample data.
84 (mock ((guix build svn) svn-fetch
85 (lambda* (url revision directory
86 #:key (svn-command "svn")
90 (with-output-to-file (string-append directory "/foo")
92 (display "source")))))
93 (let ((result (sxml->package sxml)))
96 ('name "texlive-latex-foo")
100 ('uri ('texlive-ref "latex" "foo"))
104 ('build-system 'texlive-build-system)
105 ('arguments ('quote (#:tex-directory "latex/foo")))
106 ('home-page "http://www.ctan.org/pkg/foo")
107 ('synopsis "Foomatic frobnication in LuaLaTeX")
109 "Foo is a package for LuaLaTeX. It provides an interface to \
110 frobnicate gimbals in a foomatic way with the LuaTeX engine. The package \
111 requires the bar and golly bundles for extremely special specialties.")
112 ('license 'lppl1.3+))
116 (format #t "~s\n" result)
117 (pk 'fail result #f)))))))