From 72324d80f6693e9f7b4efb204a9bd3c92e0bb692 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 24 Jan 2015 13:47:03 -0800 Subject: [PATCH] Add support for host coverage. The --host flag will pull coverage results from the host output rather than the target. Change-Id: I88aac17d23feff22926fbb67416ade3c821b5b6c --- scripts/acov | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/acov b/scripts/acov index ef7c86a95..c33ede22f 100755 --- a/scripts/acov +++ b/scripts/acov @@ -36,11 +36,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