summary refs log tree commit diff
path: root/pkgs/development/tools/misc/dejagnu/default.nix
blob: d335916bfe6a3eced41c60376f908d90dd84a830 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ fetchurl, lib, stdenv, expect, makeWrapper }:

stdenv.mkDerivation rec {
  pname = "dejagnu";
  version = "1.6.2";

  src = fetchurl {
    url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
    sha256 = "0qfj2wd4qk1yn9yzam6g8nmyxfazcc0knjyyibycb2ainkhp21hd";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ expect ];

  doCheck = true;

  # Note: The test-suite *requires* /dev/pts among the `build-chroot-dirs' of
  # the build daemon when building in a chroot.  See
  # <https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01056.html> for
  # details.

  # The test-suite needs to have a non-empty stdin:
  #   https://lists.gnu.org/archive/html/bug-dejagnu/2003-06/msg00002.html
  checkPhase = ''
    # Provide `runtest' with a log name, otherwise it tries to run
    # `whoami', which fails when in a chroot.
    LOGNAME="nix-build-daemon" make check < /dev/zero
  '';

  postInstall = ''
    wrapProgram "$out/bin/runtest" \
      --prefix PATH ":" "${expect}/bin"
  '';

  meta = with lib; {
    description = "Framework for testing other programs";

    longDescription = ''
      DejaGnu is a framework for testing other programs.  Its purpose
      is to provide a single front end for all tests.  Think of it as a
      custom library of Tcl procedures crafted to support writing a
      test harness.  A test harness is the testing infrastructure that
      is created to support a specific program or tool.  Each program
      can have multiple testsuites, all supported by a single test
      harness.  DejaGnu is written in Expect, which in turn uses Tcl --
      Tool command language.
    '';

    homepage = "https://www.gnu.org/software/dejagnu/";
    license = licenses.gpl2Plus;

    platforms = platforms.unix;
    maintainers = with maintainers; [ vrthra ];
  };
}