summaryrefslogtreecommitdiff
path: root/eclass/java-utils-2.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-18 10:02:49 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-18 10:02:49 +0100
commit8aed242683822c23f5ed6a295d3464161e2d0880 (patch)
treecb1e15198402ba7e5f401a02469a6e7219a2e9b3 /eclass/java-utils-2.eclass
parentd0678ca0b0a7eefe3151a0b6c78f5ec2dd1c0ad8 (diff)
gentoo auto-resync : 18:10:2023 - 10:02:48
Diffstat (limited to 'eclass/java-utils-2.eclass')
-rw-r--r--eclass/java-utils-2.eclass15
1 files changed, 12 insertions, 3 deletions
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 92e02e3085b1..fd1f708b86b4 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1886,13 +1886,17 @@ ejunit4() {
# @CODE
# $1 - -cp or -classpath
# $2 - the classpath passed to it
-# $@ - test classes for testng to run.
+# $@ - test classes or testng.xml for testng to run.
# @CODE
etestng() {
debug-print-function ${FUNCNAME} $*
local runner=org.testng.TestNG
- local cp=$(java-pkg_getjars --with-dependencies testng)
+ if [[ ${PN} != testng ]]; then
+ local cp=$(java-pkg_getjars --with-dependencies testng)
+ else
+ local cp=testng.jar
+ fi
local tests
if [[ ${1} = -cp || ${1} = -classpath ]]; then
@@ -1910,6 +1914,7 @@ etestng() {
-cp ${cp}
-Djava.io.tmpdir="${T}"
-Djava.awt.headless=true
+ -Dtest.resources.dir="${JAVA_TEST_RESOURCE_DIRS}"
${JAVA_TEST_EXTRA_ARGS[@]}
${runner}
${JAVA_TEST_RUNNER_EXTRA_ARGS[@]}
@@ -1922,7 +1927,11 @@ etestng() {
)
fi
- args+=( -testclass ${tests} )
+ if [[ "${test%.xml}" == "${test}" ]]; then
+ args+=( -testclass ${tests} )
+ else
+ args+=( ${tests%,} )
+ fi
debug-print "java ${args[@]}"
java ${args[@]} || die "Running TestNG failed."