diff options
author | Hsuan Ting Chen <roccochen@chromium.org> | 2022-07-06 10:47:17 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-13 16:55:17 +0000 |
commit | 9b04e0e9a0bdada307097e89610b4ce1ab9351f8 (patch) | |
tree | 7bf07358c9d67e4b807bbbccd87c14772eec2000 | |
parent | 800f5de9662b2a7345e0f56dd070a11b9d4526bc (diff) | |
download | vboot-9b04e0e9a0bdada307097e89610b4ce1ab9351f8.tar.gz |
Makefile: Hide coverage helper targets if COV is not set
We only check COV=1 in `make coverage` before. This will result in
deleting all files in the current working directory if we accidentally
tried `make coverage_init`.
Hide coverage_init and coverage_html if COV is not set.
BUG=none
BRANCH=none
TEST=make coverage_init and see the error message
TEST=make clean && COV=1 make coverage -j
Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Change-Id: I2d22b211b3d9e59d12faa0ab3d1c2ca8433598f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3747419
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
-rw-r--r-- | Makefile | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1348,6 +1348,11 @@ runtests: rununittests runtestscripts runfutiltests ${Q}echo -e "\nruntests: \E[32;1mALL TESTS PASSED SUCCESSFULLY!\E[0;m\n" # Code coverage +.PHONY: coverage +ifeq ($(filter-out 0,${COV}),) +coverage: + $(error Build coverage like this: make clean && COV=1 make coverage) +else .PHONY: coverage_init coverage_init: install_for_test rm -f ${COV_INFO}* @@ -1366,11 +1371,6 @@ coverage_html: coverage_init runtests lcov -e ${COV_INFO}.nostub '${SRCDIR}/firmware/*' \ -o ${COV_INFO}.firmware -.PHONY: coverage -ifeq ($(filter-out 0,${COV}),) -coverage: - $(error Build coverage like this: make clean && COV=1 make coverage) -else coverage: coverage_init runtests coverage_html endif |