RoboErik | a416a9b | 2011-06-20 16:34:46 -0700 | [diff] [blame^] | 1 | #TODO Modify when we move CTS tests to frameworks |
| 2 | |
| 3 | #These are instructions for generating code coverage for the provider |
| 4 | #for only the CalendarCts.java set of tests. This file can be sourced |
| 5 | #directly from the command line to generate the coverage results in |
| 6 | #your home directory. |
| 7 | |
| 8 | adb root; |
| 9 | cd ${ANDROID_BUILD_TOP}/packages/providers/CalendarProvider; |
| 10 | export EMMA_INSTRUMENT=true; |
| 11 | rm -R ${ANDROID_BUILD_TOP}/out/target/common/obj/APPS/CalendarProvider_intermediates |
| 12 | rm -R ${ANDROID_BUILD_TOP}/out/target/common/obj/APPS/CalendarProviderTests_intermediates |
| 13 | mm; |
| 14 | adb remount; |
| 15 | adb push ${ANDROID_PRODUCT_OUT}/system/app/CalendarProvider.apk system/app/CalendarProvider.apk; |
| 16 | adb push ${ANDROID_PRODUCT_OUT}/data/app/CalendarProviderTests.apk data/app/CalendarProviderTests.apk; |
| 17 | sleep 2; |
| 18 | adb shell am instrument -w -e coverage true -e class com.android.providers.calendar.CalendarCts com.android.providers.calendar.tests/android.test.InstrumentationTestRunner; |
| 19 | # we have a flakey recurrence test so the first time you run it it will sometimes fail |
| 20 | # with "count expected:<5> but was :<0>" in testSingleRecurrenceExceptions |
| 21 | if [ -d ~/emmaReport ]; then |
| 22 | rm -R ~/emmaReport; |
| 23 | fi |
| 24 | mkdir ~/emmaReport; |
| 25 | pushd ~/emmaReport; |
| 26 | adb pull /data/user/0/com.android.providers.calendar/files/coverage.ec coverage.ec; |
| 27 | java -cp ${ANDROID_BUILD_TOP}/external/emma/lib/emma.jar emma report -r html -in coverage.ec -sp ${ANDROID_BUILD_TOP}/packages/providers/CalendarProvider/src -in ${ANDROID_BUILD_TOP}/out/target/common/obj/APPS/CalendarProvider_intermediates/coverage.em; |
| 28 | popd; |