audio: Add flags to makefiles
Enable GCOV if config is set to true. Also
add gcov_flush in source files to get enhanced
code coverage.
Change-Id: I39776cc6d6f16cd23da05b66669eea22fc4cba81
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
diff --git a/voice_processing/Android.mk b/voice_processing/Android.mk
index a39df33..5b865b7 100644
--- a/voice_processing/Android.mk
+++ b/voice_processing/Android.mk
@@ -20,6 +20,12 @@
liblog \
libcutils
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_GCOV)),true)
+LOCAL_CFLAGS += --coverage -fprofile-arcs -ftest-coverage
+LOCAL_CPPFLAGS += --coverage -fprofile-arcs -ftest-coverage
+LOCAL_STATIC_LIBRARIES += libprofile_rt
+endif
+
LOCAL_SHARED_LIBRARIES += libdl
LOCAL_HEADER_LIBRARIES := libhardware_headers