xrootd: remove test-runner

XRootD 5.7.1 no longer provides bin/test-runner.
This commit is contained in:
Yueh-Shun Li 2024-10-04 12:14:24 +08:00 committed by Gaetan Lepage
parent 4a13a18e28
commit 685c830732
2 changed files with 15 additions and 45 deletions

View File

@ -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,20 +111,21 @@ stdenv.mkDerivation (finalAttrs: {
install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket
'';
cmakeFlags =
[
(lib.cmakeFeature "XRootD_VERSION_STRING" finalAttrs.version)
(lib.cmakeBool "FORCE_ENABLED" true)
(lib.cmakeBool "ENABLE_DAVIX" true)
(lib.cmakeBool "ENABLE_FUSE" (!stdenv.hostPlatform.isDarwin)) # XRootD doesn't support MacFUSE
(lib.cmakeBool "ENABLE_MACAROONS" false)
(lib.cmakeBool "ENABLE_PYTHON" false) # built separately
(lib.cmakeBool "ENABLE_SCITOKENS" true)
(lib.cmakeBool "ENABLE_VOMS" stdenv.hostPlatform.isLinux)
]
++ lib.optionals enableTestRunner [
(lib.cmakeBool "ENABLE_TESTS" true)
];
cmakeFlags = [
(lib.cmakeFeature "XRootD_VERSION_STRING" finalAttrs.version)
(lib.cmakeBool "FORCE_ENABLED" true)
(lib.cmakeBool "ENABLE_DAVIX" true)
(lib.cmakeBool "ENABLE_FUSE" (!stdenv.hostPlatform.isDarwin)) # XRootD doesn't support MacFUSE
(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)
];
# TODO(@ShamrockLee): Enable the checks.
doCheck = false;
checkInputs = [ gtest ];
postFixup = lib.optionalString (externalEtc != null) ''
moveToOutput etc "$etc"

View File

@ -1,24 +0,0 @@
{ 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"
''