summaryrefslogtreecommitdiff
path: root/test/build.mk
diff options
context:
space:
mode:
authorPaul Fagerburg <pfagerburg@google.com>2020-05-05 20:00:54 -0600
committerCommit Bot <commit-bot@chromium.org>2020-05-11 19:32:40 +0000
commitbc8a9391e7ab32f8ace80e831d28b684737ca499 (patch)
tree57ad2f0c38d30c0f50d341eafe864a3f7790a5bf /test/build.mk
parent12c3acd63fd8d73d8254afb48dc72f1deae10142 (diff)
downloadchrome-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 'test/build.mk')
-rw-r--r--test/build.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/build.mk b/test/build.mk
index 0cc3f964da..850b48c4cf 100644
--- a/test/build.mk
+++ b/test/build.mk
@@ -95,6 +95,21 @@ test-list-host += x25519
test-list-host += stillness_detector
endif
+# Build up the list of coverage test targets based on test-list-host, but
+# with some tests excluded because they cause code coverage to fail.
+
+# is_enabled_error is a shell script that does not produce coverage results
+cov-dont-test = is_enabled_error
+# static_if_error is a shell script that does not produce coverage results
+cov-dont-test += static_if_error
+# fpsensor: genhtml looks for build/host/fpsensor/cryptoc/util.c
+cov-dont-test += fpsensor
+# fpsensor_crypto: genhtml looks for build/host/fpsensor_crypto/cryptoc/util.c
+cov-dont-test += fpsensor_crypto
+# fpsensor_state: genhtml looks for build/host/fpsensor_state/cryptoc/util.c
+cov-dont-test += fpsensor_state
+cov-test-list-host = $(filter-out $(cov-dont-test), $(test-list-host))
+
accel_cal-y=accel_cal.o
aes-y=aes.o
base32-y=base32.o