Files
app_Settings/tests
Benjamin Franz 11805d159c Add unit tests to Utils
1. Switch to AndroidJUnitRunner
2. Add mockito support
3. Add tests for Utils class

Change-Id: I1eabfdf1d65456d71363b8970beee9239a90ada2
2016-01-20 18:45:36 +00:00
..
2016-01-05 07:56:37 -08:00
2016-01-20 18:45:36 +00:00
2016-01-20 18:45:36 +00:00
2016-01-20 18:45:36 +00:00

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

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

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

To run all tests in a specific class:
$ adb shell am instrument -w -e class com.android.managedprovisioning.<class> com.android.managedprovisioning.tests/android.test.InstrumentationTestRunner

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

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