Files
app_Settings/tests/unit
Daniel Nishi 9f1352b4f3 Fix the UniquePreferenceTest.
By adding in the About Phone v2 screen, we duplicated some settings.

This isn't actually a problem because when the flag to turn on V2 is on,
V1 goes away, and vice versa.

Change-Id: I9aa327ac532ed2ac240bb2d6cbb327f299438889
Bug: 72459760
Test: adb shell am instrument -w -e class
com.android.settings.core.UniquePreferenceTest
com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner
2018-01-25 02:26:17 +00:00
..
2017-09-13 09:33:48 -07:00

To build the tests you can use the following command at the root of your android source tree
$ make SettingsUnitTests

The test apk then needs to be installed onto your test device via for example
$ adb install -r out/target/product/shamu/data/app/SettingsUnitTests/SettingsUnitTests.apk

To run all tests:
$ adb shell am instrument -w com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner

To run all tests in a specific class:
$ adb shell am instrument -w -e class com.android.settings.<class> com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner

To run a specific test:
$ adb shell am instrument -w -e class com.android.settings.<class>#<test> com.android.settings.tests.unit/android.support.test.runner.AndroidJUnitRunner

More general information can be found at
http://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html