distro: Change the module name space to (gnu ...).
[jackhill/guix/guix.git] / gnu / packages / dejagnu.scm
CommitLineData
4a219a1a
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
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.
10;;;
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.
15;;;
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/>.
18
1ffa7090 19(define-module (gnu packages dejagnu)
4a219a1a
LC
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix licenses)
1ffa7090 24 #:use-module (gnu packages tcl))
4a219a1a
LC
25
26(define-public dejagnu
27 (package
28 (name "dejagnu")
29 (version "1.5")
30 (source
31 (origin
32 (method url-fetch)
33 (uri (string-append "mirror://gnu/dejagnu/dejagnu-"
34 version ".tar.gz"))
35 (sha256
36 (base32
37 "1nx3x3h96a82q92q108q71giv2nz9xmbbn2nrlr3wvvs6l45id68"))))
38 (build-system gnu-build-system)
39 (inputs `(("expect" ,expect)))
40 (arguments
41 '(#:phases (alist-replace
42 'check
43 (lambda _
44 ;; Note: The test-suite *requires* /dev/pts among the
45 ;; `build-chroot-dirs' of the build daemon when
46 ;; building in a chroot. See
47 ;; <http://thread.gmane.org/gmane.linux.distributions.nixos/1036>
48 ;; for details.
49 (if (and (directory-exists? "/dev/pts")
50 (directory-exists? "/proc"))
51 (begin
52 ;; Provide `runtest' with a log name, otherwise
53 ;; it tries to run `whoami', which fails when in
54 ;; a chroot.
55 (setenv "LOGNAME" "guix-builder")
56
57 ;; The test-suite needs to have a non-empty stdin:
58 ;; <http://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html>.
59 (zero?
60 (system "make check < /dev/zero")))
61 (begin
62 (display "test suite cannot be run, skipping\n")
63 #t)))
64 (alist-cons-after
65 '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")
75abd8ab
LC
71 (("^mypath.*$" all)
72 (string-append all
73 "export PATH="
74 expect "/bin:$PATH\n")))))
4a219a1a
LC
75 %standard-phases))))
76 (home-page
77 "http://www.gnu.org/software/dejagnu/")
78 (synopsis "The DejaGNU testing framework")
79 (description
80 "DejaGnu is a framework for testing other programs. Its purpose
81is to provide a single front end for all tests. Think of it as a
82custom library of Tcl procedures crafted to support writing a
83test harness. A test harness is the testing infrastructure that
84is created to support a specific program or tool. Each program
85can have multiple testsuites, all supported by a single test
86harness. DejaGnu is written in Expect, which in turn uses Tcl --
87Tool command language.")
88 (license gpl2+)))