From b6266dce644ea6ed47445b36c88e5cf23a6e7fb8 Mon Sep 17 00:00:00 2001 From: Harrison Houghton Date: Sat, 21 Aug 2021 12:07:55 -0400 Subject: [PATCH] zeroc-ice: enable tests The previous version said "no tests; they require network", which is not true for most tests. Just disable the ones that need it and run those that don't; some is better than none, right? --- .../libraries/zeroc-ice/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/zeroc-ice/default.nix b/pkgs/development/libraries/zeroc-ice/default.nix index 26a2ebf223fd..fcd836348556 100644 --- a/pkgs/development/libraries/zeroc-ice/default.nix +++ b/pkgs/development/libraries/zeroc-ice/default.nix @@ -1,6 +1,7 @@ { stdenv, lib, fetchFromGitHub , bzip2, expat, libedit, lmdb, openssl , darwin, libiconv, Security +, python3 # for tests only , cpp11 ? false }: @@ -52,12 +53,25 @@ in stdenv.mkDerivation rec { ) ''; - buildFlags = [ "srcs" ]; # no tests; they require network - enableParallelBuilding = true; outputs = [ "out" "bin" "dev" ]; + doCheck = true; + checkInputs = with python3.pkgs; [ passlib ]; + checkPhase = with lib; let + # these tests require network access so we need to skip them. + brokenTests = map escapeRegex [ + "Ice/udp" "Glacier2" "IceGrid/simple" "IceStorm" "IceDiscovery/simple" + ]; + # matches CONFIGS flag in makeFlagsArray + configFlag = optionalString cpp11 "--config=cpp11-shared"; + in '' + runHook preCheck + ${python3.interpreter} ./cpp/allTests.py ${configFlag} --rfilter='${concatStringsSep "|" brokenTests}' + runHook postCheck + ''; + postInstall = '' mkdir -p $bin $dev/share mv $out/bin $bin