Browse Source

Distinguishing between compile-time and runtime classpath for JUnit tests.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@944361 13f79535-47bb-0310-9956-ffa450edef68
master
Jesse N. Glick 15 years ago
parent
commit
da48edd72e
1 changed files with 8 additions and 9 deletions
  1. +8
    -9
      build.xml

+ 8
- 9
build.xml View File

@@ -125,6 +125,10 @@


<path id="tests-classpath"> <path id="tests-classpath">
<pathelement location="${build.classes}"/> <pathelement location="${build.classes}"/>
<path refid="classpath"/>
</path>
<path id="tests-runtime-classpath">
<path refid="tests-classpath"/>
<pathelement location="${build.tests}"/> <pathelement location="${build.tests}"/>
<!-- <!--
include the test source and test data dirs include the test source and test data dirs
@@ -132,13 +136,8 @@
--> -->
<pathelement location="${src.junit}"/> <pathelement location="${src.junit}"/>
<pathelement location="${tests.etc.dir}"/> <pathelement location="${tests.etc.dir}"/>
<path refid="classpath"/>
</path> </path>


<!-- turn this path into a string which is passed to the tests -->
<property name="tests-classpath.value"
refid="tests-classpath"/>

<!-- <!--
=================================================================== ===================================================================
Set up properties for the distribution area Set up properties for the distribution area
@@ -1539,13 +1538,13 @@ see ${build.junit.reports} / ${antunit.reports}
<sysproperty key="build.tests.value" value="${build.tests.value}"/> <sysproperty key="build.tests.value" value="${build.tests.value}"/>
<sysproperty key="offline" value="${offline}"/> <sysproperty key="offline" value="${offline}"/>
<sysproperty key="tests-classpath.value" <sysproperty key="tests-classpath.value"
value="${tests-classpath.value}"/>
value="${toString:tests-runtime-classpath}"/>
<sysproperty key="root" file="${basedir}"/> <sysproperty key="root" file="${basedir}"/>
<sysproperty key="build.compiler" value="${build.compiler}"/> <sysproperty key="build.compiler" value="${build.compiler}"/>
<sysproperty key="tests.and.ant.share.classloader" <sysproperty key="tests.and.ant.share.classloader"
value="${tests.and.ant.share.classloader}"/> value="${tests.and.ant.share.classloader}"/>
<classpath> <classpath>
<path refid="tests-classpath"/>
<path refid="tests-runtime-classpath"/>
<pathelement location="${junit.collector.dir}"/> <pathelement location="${junit.collector.dir}"/>
<!-- FIXME: remove failure collector build code for the moment <!-- FIXME: remove failure collector build code for the moment
<path refid="failure.cp"/> <path refid="failure.cp"/>
@@ -1581,7 +1580,7 @@ see ${build.junit.reports} / ${antunit.reports}
</condition> </condition>


<condition property="junit.testcase" value="${testcase}"> <condition property="junit.testcase" value="${testcase}">
<available classname="${testcase}" classpathref="tests-classpath" />
<available classname="${testcase}" classpathref="tests-runtime-classpath" />
</condition> </condition>


<fail>Cannot locate test ${testcase} <fail>Cannot locate test ${testcase}
@@ -1797,7 +1796,7 @@ see ${build.junit.reports} / ${antunit.reports}
<target name="interactive-tests" description="--> runs interactive tests" <target name="interactive-tests" description="--> runs interactive tests"
depends="compile-tests" depends="compile-tests"
> >
<java classpathref="tests-classpath"
<java classpathref="tests-runtime-classpath"
classname="org.apache.tools.ant.taskdefs.TestProcess" classname="org.apache.tools.ant.taskdefs.TestProcess"
fork="true"/> fork="true"/>
</target> </target>


Loading…
Cancel
Save