commit: b1cc32e229f8ab999735259f59bce334fd28eb97
Author: Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Sat Oct 25 10:37:29 2025 +0000
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Mon Dec 15 20:32:59 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1cc32e2
junit5.eclass: use JAVA_TEST_SRC_DIR as an array
Some ebuilds using junit5.eclass had to call testng_src_test() multiple
times, once for each member of ${JAVA_TEST_SRC_DIR[@]}.
Closes: https://bugs.gentoo.org/965113
Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Part-of: https://github.com/gentoo/gentoo/pull/44442
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
eclass/junit5.eclass | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/eclass/junit5.eclass b/eclass/junit5.eclass
index d031e521e1ff..687bd98b706b 100644
--- a/eclass/junit5.eclass
+++ b/eclass/junit5.eclass
@@ -387,8 +387,7 @@ _junit5_src_test_traditional() {
if [[ -n ${JAVA_TEST_RUN_ONLY} ]]; then
tests_to_run="${JAVA_TEST_RUN_ONLY[@]}"
else
- pushd "${JAVA_TEST_SRC_DIR}" > /dev/null || die
- tests_to_run=$(find * -type f\
+ tests_to_run=$(find ${JAVA_TEST_SRC_DIR[@]} -type f\
\( -name "*Test.java"\
-o -name "Test*.java"\
-o -name "*Tests.java"\
@@ -397,11 +396,10 @@ _junit5_src_test_traditional() {
! -name "*BaseTest*"\
! -name "*TestTypes*"\
! -name "*TestUtils*"\
- ! -name "*\$*")
+ ! -name "*\$*" -printf '%P\n')
tests_to_run=${tests_to_run//"${classes}"\/}
tests_to_run=${tests_to_run//.java}
tests_to_run=${tests_to_run//\//.}
- popd > /dev/null || die
# exclude extra test classes, usually corner cases
# that the code above cannot handle