summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerkan Kaba <serkan@gentoo.org>2011-03-15 19:53:05 +0000
committerSerkan Kaba <serkan@gentoo.org>2011-03-15 19:53:05 +0000
commita04cf014a47fc07bff8045faeef8e418c7d8734c (patch)
tree2a01ecf0174bc7aafb3f153aa72b7e4f98e20682 /eclass/java-utils-2.eclass
parentVersion bump for 2.5 SLOT. (diff)
downloadhistorical-a04cf014a47fc07bff8045faeef8e418c7d8734c.tar.gz
historical-a04cf014a47fc07bff8045faeef8e418c7d8734c.tar.bz2
historical-a04cf014a47fc07bff8045faeef8e418c7d8734c.zip
Add ejunit4() function to run Junit4 tests.
Diffstat (limited to 'eclass/java-utils-2.eclass')
-rw-r--r--eclass/java-utils-2.eclass64
1 files changed, 52 insertions, 12 deletions
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index da5961016384..d02746aafc79 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -6,7 +6,7 @@
#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.135 2010/04/28 19:40:40 caster Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.136 2011/03/15 19:53:05 serkan Exp $
# -----------------------------------------------------------------------------
# @eclass-begin
@@ -1754,21 +1754,18 @@ java-pkg_ant-tasks-depend() {
fi
}
+
# ------------------------------------------------------------------------------
-# @ebuild-function ejunit
+# @internal-function ejunit_
#
-# Junit wrapper function. Makes it easier to run the tests and checks for
+# Internal Junit wrapper function. Makes it easier to run the tests and checks for
# dev-java/junit in DEPEND. Launches the tests using junit.textui.TestRunner.
#
-# Examples:
-# ejunit -cp build/classes org.blinkenlights.jid3.test.AllTests
-# ejunit org.blinkenlights.jid3.test.AllTests
-#
-# @param $1 - -cp or -classpath
-# @param $2 - classpath; junit and recorded dependencies get appended
+# @param $1 - junit package (junit or junit-4)
+# @param $2 - -cp or -classpath
+# @param $3 - classpath; junit and recorded dependencies get appended
# @param $@ - the rest of the parameters are passed to java
-# ------------------------------------------------------------------------------
-ejunit() {
+ejunit_() {
debug-print-function ${FUNCNAME} $*
local pkgs
@@ -1778,7 +1775,10 @@ ejunit() {
done
fi
- local cp=$(java-pkg_getjars --with-dependencies junit${pkgs})
+ local junit=${1}
+ shift 1
+
+ local cp=$(java-pkg_getjars --with-dependencies ${junit}${pkgs})
if [[ ${1} = -cp || ${1} = -classpath ]]; then
cp="${2}:${cp}"
shift 2
@@ -1792,6 +1792,46 @@ ejunit() {
}
# ------------------------------------------------------------------------------
+# @ebuild-function ejunit
+#
+# Junit wrapper function. Makes it easier to run the tests and checks for
+# dev-java/junit in DEPEND. Launches the tests using junit.textui.TestRunner.
+#
+# Examples:
+# ejunit -cp build/classes org.blinkenlights.jid3.test.AllTests
+# ejunit org.blinkenlights.jid3.test.AllTests
+#
+# @param $1 - -cp or -classpath
+# @param $2 - classpath; junit and recorded dependencies get appended
+# @param $@ - the rest of the parameters are passed to java
+# ------------------------------------------------------------------------------
+ejunit() {
+ debug-print-function ${FUNCNAME} $*
+
+ ejunit_ "junit" "${@}"
+}
+
+# ------------------------------------------------------------------------------
+# @ebuild-function ejunit4
+#
+# Junit4 wrapper function. Makes it easier to run the tests and checks for
+# dev-java/junit:4 in DEPEND. Launches the tests using junit.textui.TestRunner.
+#
+# Examples:
+# ejunit -cp build/classes org.blinkenlights.jid3.test.AllTests
+# ejunit org.blinkenlights.jid3.test.AllTests
+#
+# @param $1 - -cp or -classpath
+# @param $2 - classpath; junit and recorded dependencies get appended
+# @param $@ - the rest of the parameters are passed to java
+# ------------------------------------------------------------------------------
+ejunit4() {
+ debug-print-function ${FUNCNAME} $*
+
+ ejunit_ "junit-4" "${@}"
+}
+
+# ------------------------------------------------------------------------------
# @section-end helper
# ------------------------------------------------------------------------------