Presently, when using testng in JAVA_TESTING_FRAMEWORKS, it gets added
to test dependencies. Emerging dev-java/testng with USE=test would lead
to a reverse dependency on itself.

This change allows emerging / testing testng with the ebuild specifying
JAVA_TESTING_FRAMEWORKS="testng" without such reverse dependency.

Signed-off-by: Volkmar W. Pogatzki <gen...@pogatzki.net>
---
 eclass/java-pkg-simple.eclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass
index abac18ca03f8..0ca0914aeee0 100644
--- a/eclass/java-pkg-simple.eclass
+++ b/eclass/java-pkg-simple.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2022 Gentoo Authors
+# Copyright 2004-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: java-pkg-simple.eclass
@@ -47,7 +47,8 @@ if has test ${JAVA_PKG_IUSE}; then
                                test_deps+=" amd64? ( dev-util/pkgdiff
                                        dev-util/japi-compliance-checker )";;
                        testng)
-                               test_deps+=" dev-java/testng:0";;
+                               [[ ${PN} != testng ]] && \
+                                       test_deps+=" dev-java/testng:0";;
                esac
        done
        [[ ${test_deps} ]] && DEPEND="test? ( ${test_deps} )"
-- 
2.41.0


Reply via email to