OK, I started to modify the build-common-targets.xml and the build-
assets.xml files and started to realize all of the things I'd have to
change to get it working, so I thought I'd just post my build.xml file
for now, then modify that stuff later :)
This compiles my utilities library using the TestRunner.mxml file,
into a TestRunner.swf Flexunit runs the generated TestRunner.swf then
outputs xml files to the specified reports dir. junitreport then
generates some nice looking reports from this xml.
Just have to add in the new flexunit4 swcs (flexunit-4.0.0.swc,
FlexUnit4CIListener.swc, flexunit-uirunner-4.0.0.swc) to the build,
the flexUnitTasks.jar file (for the <flexunit> and <junitreport>)
Here's all that's neeeded to get the testing working in flexUnit4:
<project name="utilities" basedir="." default="test">
<!-- Project specific overrides -->
<property name="root" value="." />
<property name="main.src.loc" location="${basedir}/src/main/flex" />
<property name="test.src.loc" location="${basedir}/src/test/flex" />
<property name="lib.loc" location="${basedir}/lib" />
<property name="bin.loc" location="${basedir}/bin" />
<property name="report.loc" location="${basedir}/report" />
<property name="src.flex.dir" value="src/main/flex" />
<taskdef resource="flexUnitTasks.tasks" classpath="${lib.loc}/
flexUnitTasks.jar" />
<import file="build-imports.xml" />
<!-- Build path -->
<path id="flex.lib.path">
<pathelement location="${root}/lib/flexunit-4.0.0.swc" />
<pathelement location="${root}/lib/FlexUnit4CIListener.swc" />
<pathelement location="${root}/lib/flexunit-uirunner-4.0.0.swc" />
</path>
<!-- Project specific targets -->
<target name="test">
<!-- Compile TestRunner.mxml as a SWF -->
<mxmlc
src="${test.src.loc}/TestRunner.mxml"
src.path="${main.src.loc}"
dest="${bin.loc}/TestRunner.swf" />
<!-- Execute TestRunner.swf as FlexUnit tests and publish reports --
>
<flexunit swf="${bin.loc}/TestRunner.swf" toDir="${report.loc}"
haltonfailure="false" verbose="true" localTrusted="true" />
<!-- Generate readable JUnit-style reports -->
<junitreport todir="${report.loc}">
<fileset dir="${report.loc}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${report.loc}/html" />
</junitreport>
</target>
</project>
On Nov 15, 10:48 pm, Daniel Rinehart <
dani...@neophi.com> wrote:
> I know I would be interested in seeing the changes that you have made
> even if they are in a rough form. FU4 is getting stable enough that I
> can see it starting to be used regularly.
>
> -- Daniel R. <
dani...@neophi.com> [
http://danielr.neophi.com/]