blob: 2544ea5b6af16d662d113e0989798876b4aad1b9 [file] [log] [blame]
Benjamin Franzd11b7132016-01-21 12:27:36 +00001To build the tests you can use the following command at the root of your android source tree
Roozbeh Pournaderded99002017-07-12 11:37:59 -07002$ make -j SettingsUnitTests
Benjamin Franzd11b7132016-01-21 12:27:36 +00003
4The test apk then needs to be installed onto your test device via for example
Roozbeh Pournaderded99002017-07-12 11:37:59 -07005$ adb install -r ${ANDROID_PRODUCT_OUT}/data/app/SettingsUnitTests/SettingsUnitTests.apk
Benjamin Franzd11b7132016-01-21 12:27:36 +00006
7To run all tests:
8$ adb shell am instrument -w com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
9
10To run all tests in a specific class:
11$ adb shell am instrument -w -e class com.android.settings.<class> com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
12
13To run a specific test:
14$ adb shell am instrument -w -e class com.android.settings.<class>#<test> com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
15
16More general information can be found at
17http://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html