I am new to Gradle. I use Gradle 1.10 and Ubuntu 13.
I want to know if there's any command to execute only one test class, similar to 'testonly' in SBT.
I am new to Gradle. I use Gradle 1.10 and Ubuntu 13.
I want to know if there's any command to execute only one test class, similar to 'testonly' in SBT.
Below is the command to run a single test class using
gradlew
command line option:Below example to run class
com.example.TestClass
with variantVariant_1
:You can do
gradle -Dtest.single=ClassUnderTestTest test
if you want to test single class or use regexp likegradle -Dtest.single=ClassName*Test test
you can find more examples of filtering classes for tests under this link section 23.12. Test.To run a single test class Airborn's answer is good.
With using some command line options, which found here, you can simply do something like this.
From version 1.10 of gradle it supports selecting tests, using a test filter. For example,
For multi-flavor environments (a common use-case for Android), check this answer, as the
--tests
argument will be unsupported and you'll get an error.