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 <[email protected]>
---
 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
-- 
2.41.0


Reply via email to