doc: Update htmlxref.cnf.
[guix.git] / gnu / packages / dejagnu.scm
blobf2aca50f1a2573ad056c017c541092051b3a5492
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flasher.co.il>
4 ;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages dejagnu)
22   #:use-module (guix packages)
23   #:use-module (guix download)
24   #:use-module (guix build-system gnu)
25   #:use-module (guix licenses)
26   #:use-module (gnu packages tcl))
28 (define-public dejagnu
29   (package
30     (name "dejagnu")
31     (version "1.6.1")
32     (source
33      (origin
34       (method url-fetch)
35       (uri (string-append "mirror://gnu/dejagnu/dejagnu-"
36                           version ".tar.gz"))
37       (sha256
38        (base32
39         "14hnq1mh91vqprc43xdy4f15sycw6fbajrh7zi6cw2kyg6xjhnxz"))))
40     (build-system gnu-build-system)
41     (inputs `(("expect" ,expect)))
42     (arguments
43      '(#:phases
44        (modify-phases %standard-phases
45          (replace 'check
46            (lambda _
47              ;; Note: The test-suite *requires* /dev/pts among the
48              ;; `build-chroot-dirs' of the build daemon when
49              ;; building in a chroot.  See
50              ;; <http://thread.gmane.org/gmane.linux.distributions.nixos/1036>
51              ;; for details.
52              (if (and (directory-exists? "/dev/pts")
53                       (directory-exists? "/proc"))
54                  (begin
55                   ;; Provide `runtest' with a log name, otherwise it
56                   ;; tries to run `whoami', which fails when in a chroot.
57                   (setenv "LOGNAME" "guix-builder")
59                   ;; The test-suite needs to have a non-empty stdin:
60                   ;; <http://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html>.
61                   (unless (zero? (system "make check < /dev/zero"))
62                     (error "make check failed")))
63                  (display "test suite cannot be run, skipping\n"))
64              #t))
65          (add-after 'install 'post-install
66            (lambda* (#:key inputs outputs #:allow-other-keys)
67              ;; Use the right `expect' binary.
68              (let ((out    (assoc-ref outputs "out"))
69                    (expect (assoc-ref inputs "expect")))
70                (substitute* (string-append out "/bin/runtest")
71                  (("^mypath.*$" all)
72                   (string-append all
73                                  "export PATH="
74                                  expect "/bin:$PATH\n")))
75                #t))))))
76     (home-page
77      "https://www.gnu.org/software/dejagnu/")
78     (synopsis "GNU software testing framework")
79     (description
80      "DejaGnu is a framework for testing software.  In effect, it serves as
81 a front-end for all tests written for a program.  Thus, each program can have
82 multiple test suites, which are then all managed by a single harness.")
83     (license gpl3+)))