am 942eb46a: am 6c3911d1: Merge "Add support for host coverage."

* commit '942eb46a4687443497a86d1a632b89112f619eec':
  Add support for host coverage.
This commit is contained in:
Dan Albert
2015-03-21 05:25:02 +00:00
committed by Android Git Automerger

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