Commit 685c8307 authored by Yueh-Shun Li's avatar Yueh-Shun Li Committed by Gaetan Lepage
Browse files

xrootd: remove test-runner

XRootD 5.7.1 no longer provides bin/test-runner.
parent 4a13a18e
Loading
Loading
Loading
Loading
+15 −21
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
  fetchFromGitHub,
  davix,
  cmake,
  cppunit,
  gtest,
  makeWrapper,
  pkg-config,
@@ -22,8 +21,6 @@
  systemd,
  voms,
  zlib,
  # Build bin/test-runner
  enableTestRunner ? true,
  # If not null, the builder will
  # move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc.
  externalEtc ? "/etc",
@@ -87,10 +84,6 @@ stdenv.mkDerivation (finalAttrs: {
    ++ lib.optionals stdenv.hostPlatform.isLinux [
      systemd
      voms
    ]
    ++ lib.optionals enableTestRunner [
      gtest
      cppunit
    ];

  # https://github.com/xrootd/xrootd/blob/master/packaging/rhel/xrootd.spec.in#L665-L675=
@@ -118,8 +111,7 @@ stdenv.mkDerivation (finalAttrs: {
      install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket
    '';

  cmakeFlags =
    [
  cmakeFlags = [
    (lib.cmakeFeature "XRootD_VERSION_STRING" finalAttrs.version)
    (lib.cmakeBool "FORCE_ENABLED" true)
    (lib.cmakeBool "ENABLE_DAVIX" true)
@@ -127,12 +119,14 @@ stdenv.mkDerivation (finalAttrs: {
    (lib.cmakeBool "ENABLE_MACAROONS" false)
    (lib.cmakeBool "ENABLE_PYTHON" false) # built separately
    (lib.cmakeBool "ENABLE_SCITOKENS" true)
    (lib.cmakeBool "ENABLE_TESTS" finalAttrs.doCheck)
    (lib.cmakeBool "ENABLE_VOMS" stdenv.hostPlatform.isLinux)
    ]
    ++ lib.optionals enableTestRunner [
      (lib.cmakeBool "ENABLE_TESTS" true)
  ];

  # TODO(@ShamrockLee): Enable the checks.
  doCheck = false;
  checkInputs = [ gtest ];

  postFixup = lib.optionalString (externalEtc != null) ''
    moveToOutput etc "$etc"
    ln -s ${lib.escapeShellArg externalEtc} "$out/etc"
+0 −24
Original line number Diff line number Diff line
{ runCommand, xrootd }:

# These tests are specified in the test procedure of the upstream CD:
# https://github.com/xrootd/xrootd/blob/master/.github/workflows/build.yml#L90-L98
runCommand "${xrootd.pname}-run-tests-${xrootd.version}" {
  testRunnerPath = "${xrootd}/bin/test-runner";
  testLibraries = [ "XrdClTests" ];
  XrdClTestsSuites = [ "UtilsTest" "SocketTest" "PollerTest" ];
  pname = "${xrootd.pname}-run-tests";
  inherit (xrootd) version;
  meta.mainProgram = "test-runner";
} ''
  for testLibrary in $testLibraries; do
    echo "Testing $testLibrary"
    testLibraryPath="${xrootd.out}/lib/lib''${testLibrary}.so"
    testsuiteVarname="''${testLibrary}Suites"
    for testsuite in ''${!testsuiteVarname}; do
      echo "Doing test $testsuite"
      "$testRunnerPath" "$testLibraryPath" "All Tests/$testsuite/"
    done
  done
  mkdir -p "$out/bin"
  ln -s "$testRunnerPath" "$out/bin/test-runner"
''