Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android-tests/build.xml

Issue 29347154: Issue 4206 - Add opportunity to run specific test/method only (Closed)
Patch Set: Created June 30, 2016, 7:39 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android-tests/build.xml
===================================================================
--- a/libadblockplus-android-tests/build.xml
+++ b/libadblockplus-android-tests/build.xml
@@ -84,9 +84,33 @@
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
+ <!-- custom test target to perform specific test/method only -->
+ <target
+ name="testOnly"
+ depends="-test-project-check"
+ description="Runs a single test case, given with -DtestClass=package.path.to.Class">
+
+ <property name="test.runner" value="android.test.InstrumentationTestRunner" />
+ <property name="tested.project.absolute.dir" location="${tested.project.dir}" />
+
+ <!-- Application package of the tested project extracted from its manifest file -->
+ <xpath
+ input="${tested.project.absolute.dir}/AndroidManifest.xml"
+ expression="/manifest/@package"
+ output="tested.project.app.package" />
+
+ <run-tests-helper>
+ <extra-instrument-args>
+ <arg value="-e" />
+ <arg value="class" />
Felix Dahlke 2016/06/30 09:14:34 Nit: Seems like the indentation is off here - shou
anton 2016/06/30 09:18:03 since "-e" stands for "then will follow key and va
Felix Dahlke 2016/06/30 09:27:50 Oh right, I remember :)
+ <arg value="${testClass}" />
+ </extra-instrument-args>
+ </run-tests-helper>
+ </target>
+
</project>
« no previous file with comments | « README.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld