From 35fbdb657f272b1cadb8159bcdc1ed7ad7cd4bb4 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Tue, 16 Feb 2021 15:10:01 +0100 Subject: [PATCH] ocamlPackages.uucp: enable tests --- pkgs/development/ocaml-modules/uucp/default.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/uucp/default.nix b/pkgs/development/ocaml-modules/uucp/default.nix index 536f0eb78849..433e3f9cb106 100644 --- a/pkgs/development/ocaml-modules/uucp/default.nix +++ b/pkgs/development/ocaml-modules/uucp/default.nix @@ -1,10 +1,11 @@ -{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, uunf }: +{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, uchar, uutf, uunf, uucd }: let pname = "uucp"; version = "13.0.0"; webpage = "https://erratique.ch/software/${pname}"; minimumOCamlVersion = "4.03"; + doCheck = true; in assert lib.assertMsg (lib.versionAtLeast ocaml.version minimumOCamlVersion) @@ -23,10 +24,22 @@ stdenv.mkDerivation { propagatedBuildInputs = [ uchar ]; - buildPhase = "${topkg.buildPhase} --with-cmdliner false"; + buildPhase = '' + runHook preBuild + ${topkg.buildPhase} --with-cmdliner false --tests ${lib.boolToString doCheck} + runHook postBuild + ''; inherit (topkg) installPhase; + inherit doCheck; + checkPhase = '' + runHook preCheck + ${topkg.run} test + runHook postCheck + ''; + checkInputs = [ uucd ]; + meta = with lib; { description = "An OCaml library providing efficient access to a selection of character properties of the Unicode character database"; homepage = webpage;