blob: 1a2a35d3297854a1c0b728615084558a2114e5e7 [file] [log] [blame]
RoboErika416a9b2011-06-20 16:34:46 -07001#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
8adb root;
9cd ${ANDROID_BUILD_TOP}/packages/providers/CalendarProvider;
10export EMMA_INSTRUMENT=true;
11rm -R ${ANDROID_BUILD_TOP}/out/target/common/obj/APPS/CalendarProvider_intermediates
12rm -R ${ANDROID_BUILD_TOP}/out/target/common/obj/APPS/CalendarProviderTests_intermediates
13mm;
14adb remount;
15adb push ${ANDROID_PRODUCT_OUT}/system/app/CalendarProvider.apk system/app/CalendarProvider.apk;
16adb push ${ANDROID_PRODUCT_OUT}/data/app/CalendarProviderTests.apk data/app/CalendarProviderTests.apk;
17sleep 2;
18adb shell am instrument -w -e coverage true -e class com.android.providers.calendar.CalendarCts com.android.providers.calendar.tests/android.test.InstrumentationTestRunner;
RoboErika416a9b2011-06-20 16:34:46 -070019if [ -d ~/emmaReport ]; then
20 rm -R ~/emmaReport;
21fi
22mkdir ~/emmaReport;
23pushd ~/emmaReport;
24adb pull /data/user/0/com.android.providers.calendar/files/coverage.ec coverage.ec;
25java -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;
26popd;
RoboErikbee24e72011-06-23 16:07:18 -070027export EMMA_INSTRUMENT=false;