summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolkmar W. Pogatzki <gentoo@pogatzki.net>2022-09-27 12:40:42 +0200
committerMiroslav Šulc <fordfrog@gentoo.org>2022-10-03 06:05:33 +0200
commit3eb0cfe339e79270446731b8f27bdc1b060d023b (patch)
tree37f90e54922ea412cde5b21b10dc9ba77305ce94
parentjava-pkg-simple.eclass: allow JAVA_MAIN_CLASS _and_ MANIFEST.MF (diff)
downloadgentoo-3eb0cfe3.tar.gz
gentoo-3eb0cfe3.tar.bz2
gentoo-3eb0cfe3.zip
java-pkg-simple.eclass: improve test selection for multi-jar packages
Testing multi-jar packages was not properly supported. With this change the tests_to_run are selected per module. Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/27491 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
-rw-r--r--eclass/java-pkg-simple.eclass28
1 files changed, 15 insertions, 13 deletions
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass
index 6e38a07f66e8..7a9582393dd4 100644
--- a/eclass/java-pkg-simple.eclass
+++ b/eclass/java-pkg-simple.eclass
@@ -545,19 +545,21 @@ java-pkg-simple_src_test() {
if [[ -n ${JAVA_TEST_RUN_ONLY} ]]; then
tests_to_run="${JAVA_TEST_RUN_ONLY[@]}"
else
- tests_to_run=$(find "${classes}" -type f\
- \( -name "*Test.class"\
- -o -name "Test*.class"\
- -o -name "*Tests.class"\
- -o -name "*TestCase.class" \)\
- ! -name "*Abstract*"\
- ! -name "*BaseTest*"\
- ! -name "*TestTypes*"\
- ! -name "*TestUtils*"\
- ! -name "*\$*")
- tests_to_run=${tests_to_run//"${classes}"\/}
- tests_to_run=${tests_to_run//.class}
- tests_to_run=${tests_to_run//\//.}
+ pushd "${JAVA_TEST_SRC_DIR}" > /dev/null || die
+ tests_to_run=$(find * -type f\
+ \( -name "*Test.java"\
+ -o -name "Test*.java"\
+ -o -name "*Tests.java"\
+ -o -name "*TestCase.java" \)\
+ ! -name "*Abstract*"\
+ ! -name "*BaseTest*"\
+ ! -name "*TestTypes*"\
+ ! -name "*TestUtils*"\
+ ! -name "*\$*")
+ 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