dejagnu.scm 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2016 Efraim Flashner <efraim@flasher.co.il>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; 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))
  25. (define-public dejagnu
  26. (package
  27. (name "dejagnu")
  28. (version "1.6")
  29. (source
  30. (origin
  31. (method url-fetch)
  32. (uri (string-append "mirror://gnu/dejagnu/dejagnu-"
  33. version ".tar.gz"))
  34. (sha256
  35. (base32
  36. "0qypaakd2065jgpcv84zcsibl8gph3p334gb2qdmhsrbirhlmdh0"))))
  37. (build-system gnu-build-system)
  38. (inputs `(("expect" ,expect)))
  39. (arguments
  40. '(#:phases
  41. (modify-phases %standard-phases
  42. (replace '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 it
  53. ;; tries to run `whoami', which fails when in a chroot.
  54. (setenv "LOGNAME" "guix-builder")
  55. ;; The test-suite needs to have a non-empty stdin:
  56. ;; <http://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html>.
  57. (zero?
  58. (system "make check < /dev/zero")))
  59. (begin
  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. (home-page
  73. "https://www.gnu.org/software/dejagnu/")
  74. (synopsis "GNU software testing framework")
  75. (description
  76. "DejaGnu is a framework for testing software. In effect, it serves as
  77. a front-end for all tests written for a program. Thus, each program can have
  78. multiple test suites, which are then all managed by a single harness.")
  79. (license gpl3+)))