Skip to content

Instantly share code, notes, and snippets.

@omnicolor
Created February 1, 2012 15:43
Show Gist options
  • Save omnicolor/1717620 to your computer and use it in GitHub Desktop.
Save omnicolor/1717620 to your computer and use it in GitHub Desktop.
Closure unit testing build target
<target name="test-js">
<echo message="Running javascript unit tests" />
<concat destfile="tests-concat.js">
<fileset dir="tests" includes="*Test.js" />
</concat>
<exec executable="${library}/bin/calcdeps.py">
<arg value="--compiler_flag=--compilation_level=WHITESPACE_ONLY" />
<arg value="--compiler_jar=${compiler}" />
<arg value="--input=scripts/foo.js" />
<arg value="--input=tests-concat.js" />
<arg value="--input=tests/testRunner.js" />
<arg value="--path=${library}" />
<arg value="--output_file=tests.js" />
<arg value="--output_mode=compiled" />
</exec>
<concat destfile="tests.js" append="yes">
phantom.exit();
</concat>
<delete file="tests-concat.js" />
<exec executable="${phantomjs}" outputproperty="test-results">
<arg value="tests.js" />
</exec>
<delete file="tests.js" />
<echo message="Running javascript unit tests" />
<echo message="${test-results}" />
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment