dejagnu.scm 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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/>.
  20. (define-module (gnu packages dejagnu)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (guix licenses)
  25. #:use-module (gnu packages tcl))
  26. (define-public dejagnu
  27. (package
  28. (name "dejagnu")
  29. (version "1.6.2")
  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. "0qfj2wd4qk1yn9yzam6g8nmyxfazcc0knjyyibycb2ainkhp21hd"))))
  38. (build-system gnu-build-system)
  39. (inputs `(("expect" ,expect)))
  40. (arguments
  41. '(#:phases
  42. (modify-phases %standard-phases
  43. (replace 'check
  44. (lambda _
  45. ;; Note: The test-suite *requires* /dev/pts among the
  46. ;; `build-chroot-dirs' of the build daemon when
  47. ;; building in a chroot. See
  48. ;; <http://thread.gmane.org/gmane.linux.distributions.nixos/1036>
  49. ;; for details.
  50. (if (and (directory-exists? "/dev/pts")
  51. (directory-exists? "/proc"))
  52. (begin
  53. ;; Provide `runtest' with a log name, otherwise it
  54. ;; tries to run `whoami', which fails when in a chroot.
  55. (setenv "LOGNAME" "guix-builder")
  56. ;; The test-suite needs to have a non-empty stdin:
  57. ;; <http://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html>.
  58. (unless (zero? (system "make check < /dev/zero"))
  59. (error "make check failed")))
  60. (display "test suite cannot be run, skipping\n"))
  61. #t))
  62. (add-after 'install 'post-install
  63. (lambda* (#:key inputs outputs #:allow-other-keys)
  64. ;; Use the right `expect' binary.
  65. (let ((out (assoc-ref outputs "out"))
  66. (expect (assoc-ref inputs "expect")))
  67. (substitute* (string-append out "/bin/runtest")
  68. (("^mypath.*$" all)
  69. (string-append all
  70. "export PATH="
  71. expect "/bin:$PATH\n")))
  72. #t))))))
  73. (home-page
  74. "https://www.gnu.org/software/dejagnu/")
  75. (synopsis "GNU software testing framework")
  76. (description
  77. "DejaGnu is a framework for testing software. In effect, it serves as
  78. a front-end for all tests written for a program. Thus, each program can have
  79. multiple test suites, which are then all managed by a single harness.")
  80. (license gpl3+)))