/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.83 Revision 1.84
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2005, Gentoo Foundation 5# Copyright (c) 2004-2005, Gentoo Foundation
6# 6#
7# Licensed under the GNU General Public License, v2 7# Licensed under the GNU General Public License, v2
8# 8#
9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.83 2007/05/04 17:20:08 caster Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.84 2007/05/06 09:47:36 betelgeuse Exp $
10 10
11 11
12# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
13# @eclass-begin 13# @eclass-begin
14# @eclass-shortdesc Java Utility eclass 14# @eclass-shortdesc Java Utility eclass
1651 return 0 1651 return 0
1652 fi 1652 fi
1653} 1653}
1654 1654
1655# ------------------------------------------------------------------------------ 1655# ------------------------------------------------------------------------------
1656# @ebuild-function ejunit
1657#
1658# Junit wrapper function. Makes it easier to run the tests and checks for
1659# dev-java/junit in DEPEND. Launches the tests using junit.textui.TestRunner.
1660#
1661# Examples:
1662# ejunit -cp build/classes org.blinkenlights.jid3.test.AllTests
1663# ejunit org.blinkenlights.jid3.test.AllTests
1664#
1665# @param $1 - -cp or -classpath
1666# @param $2 - classpath, junit gets appended
1667# @param $@ - the rest of the parameters are passed to java
1668# ------------------------------------------------------------------------------
1669ejunit() {
1670 debug-print-function ${FUNCNAME} $*
1671
1672 local cp
1673 if [[ ${1} = -cp || ${1} = -classpath ]]; then
1674 cp=${2}:$(java-pkg_getjars --build-only junit)
1675 shift 2
1676 else
1677 cp=$(java-pkg_getjars --build-only junit):.
1678 fi
1679
1680 local runner=junit.textui.TestRunner
1681 debug-print "Calling: java -cp \"${cp}\" -Djava.awt.headless=true ${runner} ${@}"
1682 java -cp "${cp}" -Djava.awt.headless=true ${runner} "${@}" || die "Running junit failed"
1683}
1684
1685# ------------------------------------------------------------------------------
1656# @section-end helper 1686# @section-end helper
1657# ------------------------------------------------------------------------------ 1687# ------------------------------------------------------------------------------
1658 1688
1659# ------------------------------------------------------------------------------ 1689# ------------------------------------------------------------------------------
1660# @section-begin build 1690# @section-begin build

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.84

  ViewVC Help
Powered by ViewVC 1.1.20