blob: c5c0382d77f56998c3f30b618cec6f95526c42e4 [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;
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
21if [ -d ~/emmaReport ]; then
22 rm -R ~/emmaReport;
23fi
24mkdir ~/emmaReport;
25pushd ~/emmaReport;
26adb pull /data/user/0/com.android.providers.calendar/files/coverage.ec coverage.ec;
27java -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;
28popd;