Skip to content

Commit

Permalink
Add documentation to run tests on Emulator
Browse files Browse the repository at this point in the history
Signed-off-by: utzcoz <utzcoz@outlook.com>
  • Loading branch information
utzcoz committed Mar 25, 2022
1 parent 5ddeaa6 commit 2f99efe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -60,11 +60,13 @@ Those software configurations are recommended and tested.

See [Building Robolectric](http://robolectric.org/building-robolectric/) for more details about setting up a build environment for Robolectric.

### build and test
### Building
Robolectric supports running tests against multiple Android API levels. The work it must do to support each API level is slightly different, so its shadows are built separately for each. To build shadows for every API version, run:

./gradlew clean assemble testClasses --parallel

### Testing

Run tests for all API levels:

> The fully tests could consume more than 16G memory(total of physical and virtual memory).
Expand All @@ -75,6 +77,10 @@ Run tests for part of supported API levels, e.g. run tests for API level 26, 27,

./gradlew test --parallel -Drobolectric.enabledSdks=26,27,28

Run compatibility test suites on opening Emulator:

./gradlew connectedCheck

### Using Snapshots

If you would like to live on the bleeding edge, you can try running against a snapshot build. Keep in mind that snapshots represent the most recent changes on master and may contain bugs.
Expand Down

0 comments on commit 2f99efe

Please sign in to comment.