Merge "Add support for host coverage."

This commit is contained in:
Dan Albert
2015-01-24 21:53:00 +00:00
committed by Gerrit Code Review

View File

@@ -48,11 +48,22 @@ if [ $? -ne 0 ]; then
sudo apt-get install lcov
fi
HOST=false
ANDROID_OUT=$ANDROID_PRODUCT_OUT
if [ "$1" = "--host" ]; then
HOST=true
ANDROID_OUT=$ANDROID_HOST_OUT
fi
cd $ANDROID_BUILD_TOP
FILE=cov.info
DIR=$(mktemp -d covreport-XXXXXX)
adb pull /data/local/tmp/gcov
lcov -c -d $ANDROID_PRODUCT_OUT -o $DIR/$FILE
if [ "$HOST" = "false" ]; then
adb pull /data/local/tmp/gcov
fi
lcov -c -d $ANDROID_OUT -o $DIR/$FILE
echo "Generating coverage report at $DIR"
genhtml -q -o $DIR $DIR/$FILE
xdg-open $DIR/index.html >/dev/null