diff options
author | Paul Fagerburg <pfagerburg@google.com> | 2020-05-05 20:00:54 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-11 19:32:40 +0000 |
commit | bc8a9391e7ab32f8ace80e831d28b684737ca499 (patch) | |
tree | 57ad2f0c38d30c0f50d341eafe864a3f7790a5bf /Makefile.rules | |
parent | 12c3acd63fd8d73d8254afb48dc72f1deae10142 (diff) | |
download | chrome-ec-bc8a9391e7ab32f8ace80e831d28b684737ca499.tar.gz |
ec: fix `make coverage` code coverage reporting
Fixed problems that were preventing us from building the unit tests
with code coverage testing via `make coverage`.
* Changed test_util so that programs will cleanly exit on SIGTERM.
* Changed run_host_test to wait for the child process to exit, and only
proc.kill() if it times out, so the child process will generate code
coverage output files on exit.
* Changed Makefile.toolchain to use the --coverage flag for both compile
and link.
* Changed build.mk and Makefile.rules to exclude certain tests from code
coverage because they were causing failures either during the
individual stage of code coverage, or generating the overall report.
BUG=b:143065231
BRANCH=none
TEST=`make coverage` produces results
Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org>
Change-Id: I8575013551ce1dba3fd249cd933a3cf6d110db8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2186853
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r-- | Makefile.rules | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile.rules b/Makefile.rules index 3e3ae48bc9..c40b6623a4 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -339,6 +339,7 @@ buildfuzztests: $(fuzz-test-targets) .PHONY: hosttests runhosttests runfuzztests runtests hosttests: $(host-test-targets) +runhosttests: TEST_FLAG=TEST_HOSTTEST=y runhosttests: $(run-test-targets) runfuzztests: $(run-fuzz-test-targets) runtests: runhosttests runfuzztests @@ -376,7 +377,7 @@ $(foreach b, $(cts_boards), \ ) \ ) -cov-test-targets=$(foreach t,$(test-list-host),build/host/$(t).info) +cov-test-targets=$(foreach t,$(cov-test-list-host),build/host/$(t).info) bldversion=$(shell (./util/getversion.sh ; echo VERSION) | $(CPP) -P -) # lcov fails when multiple instances run at the same time. @@ -727,6 +728,7 @@ help: @echo " tests [BOARD=] - Build all unit tests for a specific board" @echo " hosttests - Build all host unit tests" @echo " runhosttests - Build and run all host unit tests" + @echo " coverage - Build and run all host unit tests for code coverage" @echo " buildfuzztests - Build all host fuzzers" @echo " runfuzztests - Build and run all host fuzzers for one round" @echo "" |