+ a lot of work on the ant task

This commit is contained in:
cbonar 2008-09-22 22:25:32 +00:00
parent 9b12c4802c
commit f4acacd554

View file

@ -10,7 +10,6 @@
xmlns:ivy="antlib:org.apache.ivy.ant"
xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
<!-- ==================== -->
<!-- Settings -->
<!-- ==================== -->
@ -28,20 +27,18 @@
</dirset>
<dirset dir="${tests.dir}">
<include name="java"/>
<include name="javascript"/>
<include name="resources"/>
</dirset>
</path>
<!-- Resources only -->
<path id="rc.files">
<fileset dir="${src.dir}/java" excludes="**/*.java"/>
<fileset dir="${src.dir}/resources" excludes="**/*.java"/>
<fileset dir="${src.dir}/resources"/>
<fileset dir="${tests.dir}/java" excludes="**/*.java"/>
<fileset dir="${tests.dir}/javascript" excludes="**/*.java"/>
<fileset dir="${tests.dir}/resources"/>
</path>
<!-- Classpath for Java operations -->
<path id="lib.files">
<fileset dir="${lib.dir}">
@ -51,6 +48,23 @@
</fileset>
</path>
<!--
Runs JsUnit tests. This target saves a lot of verbosity in the projects' build scripts.
Firefox 3 users : change the security.fileuri.strict_origin_policy parameter to 'false' for the following target to work
// static configuration
@in jsunit.dir the directory where JsUnit resides
@in jsunit.coreJs the jsUnitCore.js file
@in jsunit.testRunner the test runner's HTML page
-->
<taskdef name="jsunit" classname="net.jsunit.ant.JsUnitTask" classpathref="lib.files">
<classpath>
<path refid="lib.files" />
<pathelement path="${classes.dir}"/>
</classpath>
</taskdef>
<!-- ==================== -->
<!-- Public targets : they are greatly inspired from the Maven build lifecycle -->
@ -91,19 +105,22 @@
<!-- NOTE : These tests should not require the code be packaged or deployed. -->
<target name="test" depends="compile" description="Tests the compiled source code using a suitable unit testing framework.">
<junit fork="false" haltonerror="true" haltonfailure="true">
<path id="testspath">
<path refid="lib.files" />
<pathelement path="${classes.dir}"/>
<!-- TODO : make the following a parameter -->
<dirset dir="${jsunit.dir}/java/config"/>
</path>
<!-- Unit tests for TestLibRunner -->
<junit fork="true" haltonerror="true" haltonfailure="true">
<sysproperty key="jsunit.testRunner" value="${jsunit.testRunner}" />
<sysproperty key="jsunit.coreJs" value="${jsunit.coreJs}" />
<sysproperty key="logsDirectory" value="${tests.logs}" />
<sysproperty key="browserFileNames" value="${jsunit.browsers}" />
<classpath>
<path refid="lib.files" />
<pathelement path="${classes.dir}"/>
<!-- TODO : make the following a parameter -->
<dirset dir="${jsunit.dir}/java/config"/>
</classpath>
<classpath refid="testspath"/>
<test name="net.jsunit.TestLibRunnerTest" todir="${tests.logs}">
<formatter type="brief" usefile="false" />
@ -112,6 +129,43 @@
</junit>
<!-- Unit test for the jsunit task itself : given an HTML test page -->
<jsunit showoutput="true"
printsummary="true"
filtertrace="false"
jsUnitRoot="${jsunit.dir}"
haltonfailure="true"
haltonerror="true"
testPage="${tests.dir}/resources/SuccessTest1.html"
>
<sysproperty key="browserFileNames" value="${jsunit.browsers}"/>
<sysproperty key="logsDirectory" value="${tests.logs}"/>
<classpath refid="testspath"/>
</jsunit>
<!-- Unit test for the jsunit task itself : given Javascript libraries -->
<jsunit showoutput="true"
printsummary="true"
filtertrace="false"
jsUnitRoot="${jsunit.dir}"
haltonfailure="true"
haltonerror="true"
fork="false"
>
<sysproperty key="browserFileNames" value="${jsunit.browsers}"/>
<sysproperty key="logsDirectory" value="${tests.logs}"/>
<fileset file="${tests.dir}/resources/success1.js"/>
<fileset file="${tests.dir}/resources/success2.js"/>
<classpath refid="testspath"/>
</jsunit>
</target>