summaryrefslogtreecommitdiffstats
path: root/build/Android.common.mk
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-09-30 22:10:10 -0700
committerDan Albert <danalbert@google.com>2015-01-30 08:57:51 -0800
commit31fb26054349db03b3f1627fe975ed099ade69dd (patch)
tree1584fbca9d5099a25ca857531b846f5b05b61de9 /build/Android.common.mk
parent28acb6feb50951645c37c077bd3897ea760ca322 (diff)
downloadart-31fb26054349db03b3f1627fe975ed099ade69dd.zip
art-31fb26054349db03b3f1627fe975ed099ade69dd.tar.gz
art-31fb26054349db03b3f1627fe975ed099ade69dd.tar.bz2
Add options for building/testing with coverage.
acov --clean mm -B NATIVE_COVERAGE=true ART_COVERAGE=true test-art-host acov --host -B is needed because you need to be sure you rebuild *all* of ART with coverage. Change-Id: Ib94ef610bd1b44dc45624877710ed733051b7a50
Diffstat (limited to 'build/Android.common.mk')
-rw-r--r--build/Android.common.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 1f040d6..0f756ef 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -20,6 +20,21 @@ ART_ANDROID_COMMON_MK = true
ART_TARGET_SUPPORTED_ARCH := arm arm64 mips mips64 x86 x86_64
ART_HOST_SUPPORTED_ARCH := x86 x86_64
+ART_COVERAGE := false
+
+ifeq ($(ART_COVERAGE),true)
+# https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html
+GCOV_PREFIX := /data/local/tmp/gcov
+# GCOV_PREFIX_STRIP is an integer that defines how many levels should be
+# stripped off the beginning of the path. We want the paths in $GCOV_PREFIX to
+# be relative to $ANDROID_BUILD_TOP so we can just adb pull from the top and not
+# have to worry about placing things ourselves.
+GCOV_PREFIX_STRIP := $(shell echo $(ANDROID_BUILD_TOP) | grep -o / | wc -l)
+GCOV_ENV := GCOV_PREFIX=$(GCOV_PREFIX) GCOV_PREFIX_STRIP=$(GCOV_PREFIX_STRIP)
+else
+GCOV_ENV :=
+endif
+
ifeq (,$(filter $(TARGET_ARCH),$(ART_TARGET_SUPPORTED_ARCH)))
$(warning unsupported TARGET_ARCH=$(TARGET_ARCH))
endif