**Root cause** ShadowFragment makes the test using an empty implementation of onCreate, hence the test execution throws SuperNotCalledException. ShadowFragment was accidentally added to this test when migrate to the latest Robolectric. Removing ShadowFragment in the config fixes the test. Fix: 300158627 Test: atest ToggleScreenMagnificationPreferenceFragmentTest Change-Id: I8782ac11a93c5f89b781dcca1713968ed18802cf
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.