CTS Verifier provides tests for APIs and functions that can't be tested on a stationary device without manual input. Currently, you can only build CTS Verifier APK from full Android source. Which takes hours to sync and build. This sample app demonstrates how to un-bundle CTS verifier to build by Android Studio. It also shows how an independent test app may report test results as a CTS verifier report.
- CTS verifier sensor test.
- Generate CTS verifier test report.
- project: Android Studio project files.
- Entry point TestListActivity.
- Tests titles are written in manifest.xml, populated by ManifestTestListAdapter
- Save report by ReportExporter.
- CTS report ResultHandler
- Re-use CTS format, from compatibility-device-util-axt
- ctsVerifier: The source code, same with that in the original CTS Verifier
- libs: Pre-built library.
- Depends on prebuild libs:
- Building and running CTS
- Alternativly, you can build it by a GCP VM
- Build the nessesary libaries for Android Studio CTS verifier sample app development
- make -j8 cts-sensors-tests compatibility-device-util-axt android.test.base_static
- cp out/target/product/generic_x86_64/obj/JAVA_LIBRARIES/cts-sensors-tests_intermediates/javalib.jar ~/Downloads/cts-sensors-tests.jar
- cp out/target/product/generic_x86_64/obj/JAVA_LIBRARIES/compatibility-device-util-axt_intermediates/javalib.jar ~/Downloads/compatibility-device-util-axt.jar
- cp out/target/product/generic_x86_64/obj/JAVA_LIBRARIES/android.test.base_static_intermediates/javalib.jar ~/Downloads/android.test.base.jar
- Remove mockito-extensions in cts-sensors-tests.jar.
- If not removed, it will cause error: "More than one file was found with OS independent path 'mockito-extensions/org.mockito.plugins.MockMaker'." ToDo:
- Make script for the GCP VM for uploading jar to bucket
- Try Google cloud build e.g. https://github.com/Alwin-Lin/GCP-automation
- Some tests will require multiple tires to pass
- Average test time is around 4 min
Fix: android:requestLegacyExternalStorage=" true"
- For Android 10 or API > 29 this will have to be present, ignore otherwise
These are the depenencies to be worked around and clean up for fully unbundle.
- SensorFeaturesDeactivator.java:142: error: cannot find symbol Settings.Secure.DOZE_ENABLED
- cts-sensors-test depends on android.test.AndroidTestCase, which is built in android.test.base_static
- cts-sensors-test and compatibility-device-util-axt both contain org.mockito.plugins.MockMaker, causing error: More than one file was found with OS independent path 'mockito-extensions/org.mockito.plugins.MockMaker'.
- Open the jar and delete mockito-extensions folder in either one.
- To unbundle pre-built libary
- Add to send report.
- Add UML milestone test time
- Optimise