You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
2.8 KiB
99 lines
2.8 KiB
9 years ago
|
# Copyright 1999-2015 Gentoo Foundation
|
||
11 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
9 years ago
|
# $Id$
|
||
11 years ago
|
|
||
|
EAPI="5"
|
||
|
|
||
|
JAVA_PKG_IUSE="doc examples source test"
|
||
|
|
||
|
inherit java-pkg-2 java-ant-2
|
||
|
|
||
10 years ago
|
DESCRIPTION="Testing framework introducing some new functionalities that make it more powerful and easier to use"
|
||
11 years ago
|
HOMEPAGE="http://testng.org/"
|
||
|
SRC_URI="http://${PN}.org/${P}.zip"
|
||
|
|
||
|
LICENSE="Apache-2.0"
|
||
11 years ago
|
KEYWORDS="~amd64 ~x86"
|
||
11 years ago
|
SLOT="0"
|
||
|
|
||
9 years ago
|
CDEPEND="
|
||
11 years ago
|
dev-java/bsh:0
|
||
|
dev-java/guice:2
|
||
|
dev-java/junit:4
|
||
9 years ago
|
dev-java/ant-core:0
|
||
|
dev-java/jcommander:0
|
||
11 years ago
|
dev-java/snakeyaml:1.9"
|
||
11 years ago
|
|
||
9 years ago
|
DEPEND=">=virtual/jdk-1.6
|
||
11 years ago
|
app-arch/zip
|
||
11 years ago
|
${CDEPEND}"
|
||
|
|
||
9 years ago
|
RDEPEND=">=virtual/jre-1.6
|
||
11 years ago
|
${CDEPEND}"
|
||
|
|
||
9 years ago
|
JAVA_ANT_CLASSPATH_TAGS+=" testng javadocs-current"
|
||
11 years ago
|
JAVA_PKG_BSFIX_NAME="build.xml build-tests.xml"
|
||
|
JAVA_ANT_REWRITE_CLASSPATH="true"
|
||
9 years ago
|
JAVA_ANT_ENCODING="ISO-8859-1"
|
||
|
|
||
11 years ago
|
EANT_GENTOO_CLASSPATH="ant-core,bsh,guice-2,jcommander,junit-4,snakeyaml-1.9"
|
||
11 years ago
|
EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH}"
|
||
|
|
||
|
EANT_BUILD_TARGET="build"
|
||
|
EANT_TEST_TARGET="tests"
|
||
|
EANT_DOC_TARGET="javadocs"
|
||
|
|
||
9 years ago
|
PATCHES=(
|
||
|
"${FILESDIR}"/${P}-remove-ivy-retrieve.patch
|
||
|
"${FILESDIR}"/${P}-remove-jar-bundling.patch
|
||
|
)
|
||
|
|
||
|
# Error: A JNI error has occurred, please check your installation and try again.
|
||
|
RESTRICT="test"
|
||
|
|
||
11 years ago
|
java_prepare() {
|
||
9 years ago
|
java-pkg_clean
|
||
11 years ago
|
|
||
|
cp "${FILESDIR}"/${P}-build-tests.xml build-tests.xml || die
|
||
|
|
||
9 years ago
|
epatch "${PATCHES[@]}"
|
||
11 years ago
|
|
||
|
# Removal of tests that break due to restrictions or environment expectations:
|
||
|
# ServiceLoaderTest - Breaks due absolute URL load that Portage prevents;
|
||
|
# we assume the underlying functionality to work, as
|
||
|
# the underlying functionality is simple and should
|
||
|
# show the usage of this package to break.
|
||
|
sed -i '/test.serviceloader.ServiceLoaderTest/d' src/test/resources/testng.xml || die
|
||
|
|
||
|
# TrueParallelTest - Doesn't always work, especially not on a system
|
||
|
# under load; since this could fail during parallel
|
||
|
# emerges, we assume the underlying functionality to
|
||
9 years ago
|
# work as it has definitely succeeded under lower load.
|
||
11 years ago
|
sed -i '/test.thread.TrueParallelTest/d' src/test/resources/testng.xml || die
|
||
|
|
||
|
mkdir lib || die
|
||
|
}
|
||
|
|
||
|
src_test() {
|
||
|
java-pkg-2_src_test
|
||
|
|
||
9 years ago
|
local tests_file="target/test-output/index.html"
|
||
|
|
||
11 years ago
|
if [[ ! -f ${tests_file} ]] ; then
|
||
|
die "Tests failed, test output does not exist; a problem with starting the tests."
|
||
|
fi
|
||
|
|
||
|
grep 'method-stats.*failed' target/test-output/index.html > /dev/null && \
|
||
|
die "Tests failed; one or more test failed, see ${tests_file} for more details."
|
||
|
}
|
||
|
|
||
|
src_install() {
|
||
|
java-pkg_newjar target/${P}.jar
|
||
|
java-pkg_dolauncher ${PN} --main org.testng.TestNG
|
||
|
java-pkg_register-ant-task
|
||
|
|
||
|
use doc && java-pkg_dojavadoc javadocs
|
||
|
use examples && java-pkg_doexamples examples
|
||
|
use source && java-pkg_dosrc src/main/java/{org,com}
|
||
|
}
|