1 |
commit: 51e27b02d555d31977600d44ce26b6aa04d1987a |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 7 12:25:36 2022 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 7 12:26:04 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51e27b02 |
7 |
|
8 |
net-libs/xrootd: run native tests at build time instead of just installing them |
9 |
|
10 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
11 |
|
12 |
net-libs/xrootd/xrootd-5.4.3-r2.ebuild | 30 ++++++++++++++++++++++-------- |
13 |
1 file changed, 22 insertions(+), 8 deletions(-) |
14 |
|
15 |
diff --git a/net-libs/xrootd/xrootd-5.4.3-r2.ebuild b/net-libs/xrootd/xrootd-5.4.3-r2.ebuild |
16 |
index e0c005ecfcb9..835ba9ab3318 100644 |
17 |
--- a/net-libs/xrootd/xrootd-5.4.3-r2.ebuild |
18 |
+++ b/net-libs/xrootd/xrootd-5.4.3-r2.ebuild |
19 |
@@ -16,11 +16,9 @@ SRC_URI="https://xrootd.slac.stanford.edu/download/v${PV}/${P}.tar.gz" |
20 |
LICENSE="LGPL-3" |
21 |
SLOT="0" |
22 |
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" |
23 |
-IUSE="doc examples fuse http kerberos +libxml2 python readline +server systemd test test-suite" |
24 |
+IUSE="doc examples fuse http kerberos +libxml2 python readline +server systemd test" |
25 |
|
26 |
-# Python tests currently require manual configuration and start-up of an xrootd server. |
27 |
-# No actual build-time test suite for native code. |
28 |
-RESTRICT="test" |
29 |
+RESTRICT="!test? ( test )" |
30 |
|
31 |
CDEPEND="acct-group/xrootd |
32 |
acct-user/xrootd |
33 |
@@ -34,7 +32,6 @@ CDEPEND="acct-group/xrootd |
34 |
python? ( ${PYTHON_DEPS} ) |
35 |
readline? ( sys-libs/readline:0= ) |
36 |
systemd? ( sys-apps/systemd:= ) |
37 |
- test-suite? ( dev-util/cppunit ) |
38 |
" |
39 |
DEPEND="${CDEPEND}" |
40 |
BDEPEND=" |
41 |
@@ -48,6 +45,7 @@ BDEPEND=" |
42 |
${DISTUTILS_DEPS} |
43 |
test? ( >=dev-python/pytest-7.1.2[${PYTHON_USEDEP}] ) |
44 |
) |
45 |
+ test? ( dev-util/cppunit ) |
46 |
" |
47 |
RDEPEND="${CDEPEND} |
48 |
dev-lang/perl |
49 |
@@ -56,7 +54,6 @@ REQUIRED_USE=" |
50 |
http? ( kerberos ) |
51 |
python? ( ${PYTHON_REQUIRED_USE} ) |
52 |
test? ( server ) |
53 |
- test-suite? ( server ) |
54 |
" |
55 |
|
56 |
PATCHES=( |
57 |
@@ -95,7 +92,7 @@ src_configure() { |
58 |
-DENABLE_LIBXML2=$(usex libxml2) |
59 |
-DENABLE_PYTHON=$(usex python) |
60 |
-DENABLE_READLINE=$(usex readline) |
61 |
- -DENABLE_TESTS=$(usex test-suite) |
62 |
+ -DENABLE_TESTS=$(usex test) |
63 |
-DENABLE_VOMS=no |
64 |
-DFORCE_ENABLED=yes |
65 |
-DXRDCL_ONLY=$(usex server "no" "yes") |
66 |
@@ -129,7 +126,17 @@ python_test() { |
67 |
} |
68 |
|
69 |
src_test() { |
70 |
- use python && distutils-r1_src_test |
71 |
+ pushd "${BUILD_DIR}/tests" > /dev/null || die |
72 |
+ # There are more tests but since these are ones currently run by upstream in their CI, |
73 |
+ # let's follow their example. |
74 |
+ ./common/test-runner ./XrdClTests/libXrdClTests.so "All Tests/UtilsTest/" || die |
75 |
+ ./common/test-runner ./XrdClTests/libXrdClTests.so "All Tests/SocketTest/" || die |
76 |
+ ./common/test-runner ./XrdClTests/libXrdClTests.so "All Tests/PollerTest/" || die |
77 |
+ popd > /dev/null || die |
78 |
+ |
79 |
+ # Python tests currently require manual configuration and start-up of an xrootd server. |
80 |
+ # TODO: get this to run properly. |
81 |
+ #use python && distutils-r1_src_test |
82 |
} |
83 |
|
84 |
src_install() { |
85 |
@@ -170,4 +177,11 @@ src_install() { |
86 |
dodoc -r bindings/python/examples |
87 |
fi |
88 |
fi |
89 |
+ |
90 |
+ if use test; then |
91 |
+ for f in test-runner xrdshmap; do |
92 |
+ rm "${ED}"/usr/bin/${f} || die "Failed to remove test helper ${f} from installed tree" |
93 |
+ done |
94 |
+ rm "${ED}"/usr/$(get_libdir)/libXrdClTest*.so || die "Failed to remove test libraries from installed tree" |
95 |
+ fi |
96 |
} |