Should avoid spying on Android classes due to potential test pollution: https://robolectric.org/best-practices/ Bug: 315399487 Test: atest SettingsRoboTests:com.android.settings.homepage.contextualcards.slices --iterations 20 Change-Id: Ia52baf52bf43d3a3959dc0234fbfc5b4a4575dac
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.