in android from command line i am trying to run just a single test case. from the IDE it works fine by right click.
But when i try to do it using the following command in CLI IT FAILS:
./gradlew test --tests "com.xyz.b.module.TestClass.testToRun"
i get the following error:
> Unknown command-line option '--tests'.
i guess its a old thread perhaps but i was following here:
Anyway , how can i run my UNIT TEST single method ? i want to emphasis that i want to run a single unit test not instrumentation test from command line.
it should . also be noted my tests are in kotlin and like this:
fun 'i am testing something'(){
//..Arrange
//..Act
//..Assert
}
i guess spaces replaced by underscore right ?
update: i have a camera app. imagine i have a build variant called usCameraDebug. that means united states camera debug. now can you tell me how to run a single test case i called mySingleTest.
i tried this as you mentioned: ./gradlew test --tests "*mySingleTest"
and ./gradlew app:usCameraDebug test --tests "*mySingleTest"
and also: ./gradlew app:usCameraDebugUnitTest --tests "*mySingleTest"
but it . does not work. caan you tell me exactly what to type based on my build variant. its in a module called "app" as defaulted.
here is the test i want to run:
package com.xyz.cameras.parts
@Test
fun mySingleTest(){
assertEquals(12,13)
}