Run unit tests
gradle_testRuns Android unit tests for a module or filter, then returns pass/fail counts and each failure with message and file:line from Gradle test-result XML.
Instructions
Runs unit tests for a module (optionally filtered) and returns pass/fail counts plus each failure with message and file:line, read from build/test-results XML.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectDir": "<projectDir>"
},
"name": "gradle_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | No | Default "testDebugUnitTest" | |
| filter | No | --tests pattern, e.g. "com.foo.BarTest" or "*Login*" | |
| module | No | Gradle module path, default ":app" | |
| projectDir | Yes | Absolute path to the Android project (gradlew is searched upwards) | |
| maxFailures | No | Default 15 |