commit:     b2147e61a6255b4ee2ae85bad142aa9d2c2d5f17
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  8 23:33:24 2025 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 23:33:24 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2147e61

dev-libs/bglibs: disable the one failing network test

Closes: https://bugs.gentoo.org/687390
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-libs/bglibs/bglibs-2.04-r3.ebuild | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/dev-libs/bglibs/bglibs-2.04-r3.ebuild 
b/dev-libs/bglibs/bglibs-2.04-r3.ebuild
index cf69431cce50..1327b6161114 100644
--- a/dev-libs/bglibs/bglibs-2.04-r3.ebuild
+++ b/dev-libs/bglibs/bglibs-2.04-r3.ebuild
@@ -34,9 +34,22 @@ PATCHES=(
 
 src_prepare() {
        default
-       # disable tests as we want them manually
+
+       # Remove the tests from the default target so that we can run
+       # them only when the user has enabled them.
        sed -i '/^all:/s|selftests||' Makefile || die
        sed -i '/selftests/d' TARGETS || die
+
+       # The selftests.sh script collects the list of tests to run by
+       # grepping for "#ifdef SELFTEST_MAIN", which is defined in each *.c
+       # file to be tested. We can therefore disable individual tests by
+       # clobbering that line. (This should be safe; the contents of that
+       # ifdef are the test program, which we are disabling anyway.)
+       #
+       # This test requires network access, and currently fails even
+       # if you have it (https://github.com/bruceg/bglibs/issues/5).
+       sed -e 's/#ifdef SELFTEST_MAIN/#ifdef UNDEFINED/' \
+               -i net/resolve_ipv4addr.c || die
 }
 
 src_configure() {

Reply via email to