mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-10 09:26:19 +00:00
36 lines
1.1 KiB
XML
36 lines
1.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project name="custom_rules">
|
|
|
|
<target name="-pre-build" >
|
|
<!-- Make Travis build number available to the test app in the emulator -->
|
|
<if>
|
|
<condition>
|
|
<isset property="env.TRAVIS_BUILD_NUMBER" />
|
|
</condition>
|
|
<then>
|
|
<replaceregexp
|
|
file="res/values/setup.xml"
|
|
match='("build_number">)\s*(<)'
|
|
replace="\1${env.TRAVIS_BUILD_NUMBER}\2"
|
|
byline="true" />
|
|
</then>
|
|
</if>
|
|
</target>
|
|
|
|
<!-- Run regular Android target 'test', but fails if any test is not successful -->
|
|
<target name="acceptance-test" depends="clean, debug, install" >
|
|
<property name="log.file" value="tests_output.txt" />
|
|
<record name="${log.file}" action="start" />
|
|
<antcall target="test" /> <!-- regular Android target -->
|
|
<record name="${log.file}" action="stop" />
|
|
<loadfile property="tests.output" srcFile="${log.file}" />
|
|
<echo>Checking for failures</echo>
|
|
<fail message="Acceptance tests failed." >
|
|
<condition>
|
|
<contains string="${tests.output}" substring="FAILURES" />
|
|
</condition>
|
|
</fail>
|
|
<echo>All tests passed.</echo>
|
|
</target>
|
|
|
|
</project> |