Skip to content

Commit d7549d2

Browse files
Adds documentation on how to filter local unit tests
1 parent f72034c commit d7549d2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

AndroidTestingBlueprint/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,23 @@ From command-line via Gradle:
6161
- To run the local unit tests in a module execute:
6262

6363
```
64-
./gradlew {module}:test
64+
./gradlew :{module}:test
6565
```
6666

67+
- To filter local unit tests to run, you can use:
68+
69+
```
70+
./gradlew :app:testFlavor1DebugUnitTest --tests "com.example.android.testing.blueprint.*"
71+
```
72+
73+
In general, in a project with no flavors:
74+
75+
```
76+
./gradlew :{module}:testDebugUnitTest --tests {test-filter}
77+
```
78+
79+
Note that you cannot use `./gradlew :app:test` or `./gradlew test` with a filter. Read the [gradle documentation on test filtering](https://docs.gradle.org/current/userguide/java_plugin.html#test_filtering) for more information.
80+
6781
## Testing frameworks and APIs
6882

6983
### Espresso

0 commit comments

Comments
 (0)