[dev-libs/mongo-c-driver] add a test-full useflag to mask on non-mongodb arches

This commit is contained in:
Robert Förster 2024-06-25 01:41:24 +02:00
parent 45aadb32ea
commit 9cf87dd318
2 changed files with 25 additions and 12 deletions

View File

@ -5,6 +5,12 @@
<email>ultrabug@gentoo.org</email> <email>ultrabug@gentoo.org</email>
<name>Alexys Jacob</name> <name>Alexys Jacob</name>
</maintainer> </maintainer>
<use>
<flag name="test-full">
Run test suite in full, including tests that run a local
database instance.
</flag>
</use>
<upstream> <upstream>
<remote-id type="github">mongodb/mongo-c-driver</remote-id> <remote-id type="github">mongodb/mongo-c-driver</remote-id>
</upstream> </upstream>

View File

@ -12,7 +12,7 @@ SRC_URI="https://github.com/mongodb/mongo-c-driver/archive/refs/tags/${PV}.tar.g
LICENSE="Apache-2.0" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86" KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86"
IUSE="debug examples icu +s3 sasl +ssl static-libs test" IUSE="debug examples icu +s3 sasl +ssl static-libs test +test-full"
REQUIRED_USE=" REQUIRED_USE="
s3? ( ssl ) s3? ( ssl )
test? ( static-libs )" test? ( static-libs )"
@ -36,10 +36,12 @@ RDEPEND="
DEPEND=" DEPEND="
${RDEPEND} ${RDEPEND}
test? ( test? (
dev-db/mongodb
dev-libs/libbson[static-libs] dev-libs/libbson[static-libs]
>=dev-libs/libmongocrypt-1.10.0[static-libs] >=dev-libs/libmongocrypt-1.10.0[static-libs]
>=dev-libs/libutf8proc-2.8.0:=[static-libs] >=dev-libs/libutf8proc-2.8.0:=[static-libs]
test-full? (
dev-db/mongodb
)
) )
" "
@ -89,16 +91,21 @@ src_configure() {
# FEATURES="test -network-sandbox" USE="static-libs" emerge dev-libs/mongo-c-driver # FEATURES="test -network-sandbox" USE="static-libs" emerge dev-libs/mongo-c-driver
src_test() { src_test() {
local PORT=27099 if ! use test-full; then
LC_ALL=C \ export MONGOC_TEST_SKIP_LIVE=on
mongod --setParameter enableTestCommands=1 \ else
--enableMajorityReadConcern --port ${PORT} \ local PORT=27099
--bind_ip 127.0.0.1 --nounixsocket --fork --dbpath="${T}" \ export MONGOC_TEST_URI="mongodb://[127.0.0.1]:${PORT}"
--logpath="${T}/mongod.log" || die export MONGOC_ENABLE_MAJORITY_READ_CONCERN=on
MONGOC_TEST_URI="mongodb://[127.0.0.1]:${PORT}" \ LC_ALL=C \
MONGOC_ENABLE_MAJORITY_READ_CONCERN=on \ mongod --setParameter enableTestCommands=1 \
../mongo-c-driver-${PV}_build/src/libmongoc/test-libmongoc \ --enableMajorityReadConcern --port ${PORT} \
--skip-tests "${FILESDIR}/skip-tests.txt" || die --bind_ip 127.0.0.1 --nounixsocket --fork \
--dbpath="${T}" --logpath="${T}/mongod.log" || die
fi
../mongo-c-driver-${PV}_build/src/libmongoc/test-libmongoc \
--skip-tests "${FILESDIR}/skip-tests.txt" || die
kill $(<"${T}/mongod.lock") kill $(<"${T}/mongod.lock")
} }