summaryrefslogtreecommitdiff
path: root/Makefile.toolchain
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-06-12 00:08:56 +0800
committerChromeBot <chrome-bot@google.com>2013-06-16 20:14:01 -0700
commitaaac3935d2e82b281979045a390f0b7d2c79b281 (patch)
tree8eafe931dd051f04ad85f7a270c6aafdd628deb0 /Makefile.toolchain
parent7402388c587e03181559f859f797f27c840c32ab (diff)
downloadchrome-ec-aaac3935d2e82b281979045a390f0b7d2c79b281.tar.gz
Make target for test coverage report generation
By 'make coverage', lcov is used to generate test coverage report in HTML format stored in coverage_rpt folder. BUG=chrome-os-partner:19235 TEST=Generate a report. BRANCH=None Change-Id: I44142eaaeb897cf09179764781120370920144cd Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/58203
Diffstat (limited to 'Makefile.toolchain')
-rw-r--r--Makefile.toolchain8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain
index 2679e2b5f1..c9de7aaf78 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -30,11 +30,14 @@ CFLAGS_TEST=$(if $(TEST_BUILD),-DTEST_BUILD \
-DTEST_TASKFILE=$(PROJECT).tasklist,) \
$(if $(EMU_BUILD),-DEMU_BUILD) \
$(if $($(PROJECT)-scale),-DTEST_TIME_SCALE=$($(PROJECT)-scale))
+CFLAGS_COVERAGE=$(if $(TEST_COVERAGE),-fprofile-arcs -ftest-coverage \
+ -DTEST_COVERAGE,)
CFLAGS_DEFINE=-DOUTDIR=$(out) -DCHIP=$(CHIP) -DBOARD_TASKFILE=ec.tasklist \
-DBOARD=$(BOARD) -DBOARD_$(BOARD) -DCORE=$(CORE) \
-DCHIP_$(CHIP) -DCHIP_VARIANT=$(CHIP_VARIANT) \
-DCHIP_VARIANT_$(CHIP_VARIANT) -DPROJECT=$(PROJECT)
-CPPFLAGS=$(CFLAGS_DEFINE) $(CFLAGS_INCLUDE) $(CFLAGS_TEST) $(EXTRA_CFLAGS)
+CPPFLAGS=$(CFLAGS_DEFINE) $(CFLAGS_INCLUDE) $(CFLAGS_TEST) \
+ $(EXTRA_CFLAGS) $(CFLAGS_COVERAGE)
CFLAGS=$(CPPFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEBUG) $(CFLAGS_WARN) $(CFLAGS_y)
FTDIVERSION=$(shell $(PKG_CONFIG) --modversion libftdi1 2>/dev/null)
@@ -51,4 +54,5 @@ BUILD_CFLAGS= $(LIBFTDI_CFLAGS) $(CPPFLAGS) -O3 $(CFLAGS_DEBUG) $(CFLAGS_WARN)
HOST_CFLAGS=$(CPPFLAGS) -O3 $(CFLAGS_DEBUG) $(CFLAGS_WARN)
LDFLAGS=-nostdlib -X
BUILD_LDFLAGS=$(LIBFTDI_LDLIBS)
-HOST_TEST_LDFLAGS=-T core/host/host_exe.lds -lrt -pthread
+HOST_TEST_LDFLAGS=-T core/host/host_exe.lds -lrt -pthread \
+ $(if $(TEST_COVERAGE),-fprofile-arcs,)