Android Cts Manual r4
Android Cts Manual r4
Android Cts Manual r4
Google Confidential
Contents 1. Why be compatible?....................................................................... 3 2. How can I become compatible? .................................................... 4 2.1. Comply with Android Compatibility Definition document............ 4 2.2. Pass the Compatibility Test Suite (CTS).................................... 4 2.3. Submit report ............................................................................. 4 3. How does the CTS work?............................................................... 5 3.1. Workflow .................................................................................... 5 3.2. Types of test cases .................................................................... 6 3.3. Areas Covered ........................................................................... 6 4. Setting up and using the CTS........................................................ 8 4.1. Configuring the CTS .................................................................. 8 4.2. Setting up your device ............................................................... 0 4.3. Using the CTS............................................................................ 0 4.4. Selecting CTS Plans .................................................................. 9 5. Interpreting the Test Results ....................................................... 11 6. Release Notes ............................................................................... 13 6.1. General .................................................................................... 13 6.2. Known Framework issues ........................................................ 13 6.3. Known Test issues ..................................................................... 0 7. Appendix: CTS Console Command Reference.......................... 14
Google Confidential
1. Why be compatible?
1. Give your users the best possible experience with the applications they run. When a device is compatible with Android, users can choose from among many high-quality applications. Applications that take full advantage of Android's features are likely to perform best on compatible devices. 2. Make it easy for developers to write top-quality applications for your device. Developers want to streamline their applications for Android, and this is easiest for them when they are writing for a predictable platform. 3. Take advantage of the Android Market. Compatible handsets can give users access to the Android Market. Android compatibility is free, and it's easy.
Google Confidential
Google Confidential
The CTS is an automated testing harness that includes two major software components: The CTS test harness runs on your desktop machine and manages test execution. Individual test cases are executed on attached mobile devices or on an emulator. The test cases are written in Java as JUnit tests and packaged as Android .apk files to run on the actual device target.
3.1. Workflow
1. Use the bundled CTS release or download the CTS from the Android Open Source Project onto your desktop machine. 2. Install and configure the CTS. 3. Attach at least one device (or emulator) to your machine. 4. Launch the CTS. The CTS test harness loads the test plan onto the attached devices. For each test in the test harness: The test harness pushes a .apk file to each device, executes the test through instrumentation, and records test results. The test harness removes the .apk file from each device. 5. Once all the tests are executed, you can view the test results in your browser and use the results to adjust your design. You can continue to run the CTS throughout your development process. When you are ready, you can submit the report generated by the CTS to
Google Confidential
[email protected]. The report is a .zip archived file that contains XML results and supplemental information such as screen captures.
Area
Description For each Android release, there are XML files describing the signatures of all public APIs contained in the release. The CTS contains a utility to check those API signatures against the APIs available on the device. The results from signature checking are recorded in the test result XML file. Test the platform (core libraries and Android Application Framework) APIs as documented in the SDK Class Index to ensure API correctness: correct class, attribute and method signatures correct method behavior negative tests to ensure expected behavior for incorrect parameter handling The tests focus on testing the Dalvik VM The CTS tests the core platform data model as exposed to application developers through content providers, as documented in the SDK android.provider package: contacts browser
Signature tests
Dalvik VM Tests
Google Confidential
settings more... The CTS tests the core platform intents, as documented in the SDK Available Intents.
Platform Intents
The CTS tests the core platform permissions, as documented in the Platform Permissions SDK Available Permissions. The CTS tests for correct handling of the core platform resource types, as documented in the SDK Available Resource Types. This includes tests for: simple values drawables nine-patch animations layouts styles and themes loading alternate resources
Platform Resources
Google Confidential
Google Confidential
12. Make sure the device is at the home screen at the start of CTS (Press the home button). 13. While a device is running tests, it must not be used for any other tasks. 14. Do not press any keys on the device while CTS is running. Pressing keys or touching the screen of a test device will interfere with the running tests and may lead to test failures. 15. Set up accessibility tests: 1. adb install android-cts/repository/testcases/
CtsDelegatingAccessibilityService.apk
2. On the device, enable Settings > Accessibility > Delegating Accessibility Service 16. Set up device administration tests: 1. adb install android-cts/repository/testcases/
CtsDeviceAdmin.apk
2. On the device, enable Settings > Security > Device Administrators > android.deviceadmin.cts.CtsDeviceAdmin* settings
Google Confidential
7. Performance - contains performance tests for your implementation (more coming in future CTS releases) These can be executed with the run cts command as mentioned earlier.
Google Confidential
The 'device information' section provides details about the device and the firmware (make, model, firmware build, platform) and the hardware on the device (screen resolution, keypad, screen type). The details of the executed test plan are present in the 'test summary' section which provides the CTS plan name and execution start and end times. It also presents an aggregate summary of the number of tests that passed, failed, time out or could not be executed. The next section also provides a summary of tests passed per package.
Google Confidential
This is followed by details of the the actual tests that were executed. The report lists the test package, test suite, test case and the executed tests. It shows the result of the test execution - pass, fail, timed out or not executed. In the event of a test failure details are provided to help diagnose the cause. Further, the stack trace of the failure is available in the XML file but is not included in the report to ensure brevity - viewing the XML file with a text editor should provide details of the test failure (search for the <Test> tag corresponding to the failed test and look within it for the <StackTrace> tag).
Google Confidential
6. Release Notes
6.1. General
Note the CTS test harness has changed signficantly in the Android 4.0 release. Some new features have been added included support for sharding a CTS test run onto multiple concurrent devices, as well as general faster performance. This CTS release contains approximately 17,000 tests that you can execute on the device. Please make sure all steps in section 4.2 "Setting up your device" have been followed before you kick off CTS. Not following these instructions may cause tests to timeout or fail.
Google Confidential
Host help help all Display a summary of the most commonly used commands. display the complete list of available commands Gracefully exit the CTS console. Console will close when all currently running tests are finished
Run the specified tests and displays progress information. One of --plan, -package, --class or --continue-session-id needs to be specified. The CTS console can accept other commands while tests are in progress. If no devices are connected, the CTS host will wait for a device to be connected before starting tests. If more than one device is connected, CTS host will choose a device automatically.
--plan <test_plan_name> Run the specified test plan -- package/-p <test_package_name> [-package/-p <test_package2>...] --class/-c <class_name> [--method/-m <test_method_name> --continue-session-id Runs all not executed tests from previous CTS session. The sessions testResult.xml will be updated with the new results. Runs the specified test packages. Runs the specified test class and/or method
Google Confidential
--shards <number_of_shards> Shard a CTS run into given number of independent chunks, to run on multiple devices in parallel. --serial/-s <deviceID> Run CTS on the specific device List list packages List all available test packages in the repository. Lists all available test plans in the repository Lists 'run' commands currently being executed on devices. List all 'run' commands currently in the queue waiting to be assigned to devices List CTS results currently stored in repository List currently connected devices and their state. 'Available' devices are functioning, idle devices, available for running tests. list devices 'Unavailable' devices are devices visible via adb, but are not responding to adb commands and won't be allocated for tests. 'Allocated' devices are devices currently running tests. Add add derivedplan --plan <plan_name> --result/-r [pass | fail | timeout | notExecuted] [--session/-s <session_id>] Create a plan derived from given result session.
Google Confidential
Google Confidential