public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] java-pkg-simple.eclass: improve test selection for multi-jar packages
@ 2022-09-27 11:49 Volkmar W. Pogatzki
  0 siblings, 0 replies; only message in thread
From: Volkmar W. Pogatzki @ 2022-09-27 11:49 UTC (permalink / raw
  To: gentoo-dev

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>
---
 eclass/java-pkg-simple.eclass | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass
index 6e38a07f66e..7a9582393dd 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
-- 
2.35.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-27 11:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-27 11:49 [gentoo-dev] [PATCH] java-pkg-simple.eclass: improve test selection for multi-jar packages Volkmar W. Pogatzki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox