1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
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 (gnu packages dejagnu)
20 #:use-module (guix packages)
21 #:use-module (guix download)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix licenses)
24 #:use-module (gnu packages tcl))
26 (define-public dejagnu
33 (uri (string-append "mirror://gnu/dejagnu/dejagnu-"
37 "1nx3x3h96a82q92q108q71giv2nz9xmbbn2nrlr3wvvs6l45id68"))))
38 (build-system gnu-build-system)
39 (inputs `(("expect" ,expect)))
41 '(#:phases (alist-replace
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>
49 (if (and (directory-exists? "/dev/pts")
50 (directory-exists? "/proc"))
52 ;; Provide `runtest' with a log name, otherwise
53 ;; it tries to run `whoami', which fails when in
55 (setenv "LOGNAME" "guix-builder")
57 ;; The test-suite needs to have a non-empty stdin:
58 ;; <http://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html>.
60 (system "make check < /dev/zero")))
62 (display "test suite cannot be run, skipping\n")
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")
74 expect "/bin:$PATH\n")))))
77 "http://www.gnu.org/software/dejagnu/")
78 (synopsis "GNU software testing framework")
80 "DejaGnu is a framework for testing other programs. Its purpose
81 is to provide a single front end for all tests. Think of it as a
82 custom library of Tcl procedures crafted to support writing a
83 test harness. A test harness is the testing infrastructure that
84 is created to support a specific program or tool. Each program
85 can have multiple testsuites, all supported by a single test
86 harness. DejaGnu is written in Expect, which in turn uses Tcl --
87 Tool command language.")