From bad8b386e6dcf0302e1ebe855017390038bee11d Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Tue, 9 Jun 2020 12:39:36 +0100 Subject: [PATCH] Rename native code coverage paths product variables in Make. Rename `CoveragePath` and `CoverageExcludePaths` as `NativeCoveragePath` and `NativeCoverageExcludePaths` (resp.). Also, populate `NativeCoveragePath` and `NativeCoverageExcludePaths` from environment variables `NATIVE_COVERAGE_PATHS` and `NATIVE_COVERAGE_EXCLUDE_PATHS` (resp.). Test: m nothing Bug: 158212027 Change-Id: I409dbb04b09744a7bd95a4b69361e858b9f89e23 --- core/binary.mk | 8 ++++++-- core/line_coverage.mk | 2 +- core/soong_config.mk | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index 4894bf2b6..2a31fdd76 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -71,8 +71,12 @@ ifeq (,$(strip $(my_cc))$(strip $(my_cxx))) my_pool := $(GOMA_OR_RBE_POOL) endif -ifneq (,$(strip $(foreach dir,$(COVERAGE_PATHS),$(filter $(dir)%,$(LOCAL_PATH))))) -ifeq (,$(strip $(foreach dir,$(COVERAGE_EXCLUDE_PATHS),$(filter $(dir)%,$(LOCAL_PATH))))) +# TODO(b/158212027): Remove `$(COVERAGE_PATHS)` from this condition when all users have been moved +# to `NATIVE_COVERAGE_PATHS`. +ifneq (,$(strip $(foreach dir,$(COVERAGE_PATHS) $(NATIVE_COVERAGE_PATHS),$(filter $(dir)%,$(LOCAL_PATH))))) +# TODO(b/158212027): Remove `$(COVERAGE_EXCLUDE_PATHS)` from this condition when all users have been +# moved to `NATIVE_COVERAGE_EXCLUDE_PATHS`. +ifeq (,$(strip $(foreach dir,$(COVERAGE_EXCLUDE_PATHS) $(NATIVE_COVERAGE_EXCLUDE_PATHS),$(filter $(dir)%,$(LOCAL_PATH))))) my_native_coverage := true else my_native_coverage := false diff --git a/core/line_coverage.mk b/core/line_coverage.mk index 9b0b52860..b920e285d 100644 --- a/core/line_coverage.mk +++ b/core/line_coverage.mk @@ -9,7 +9,7 @@ # # To run the make target set the coverage related envvars first: # NATIVE_LINE_COVERAGE=true NATIVE_COVERAGE=true \ -# COVERAGE_PATHS=* make haiku-line-coverage +# NATIVE_COVERAGE_PATHS=* make haiku-line-coverage # ----------------------------------------------------------------- # TODO(b/148306195): Due this issue some fuzz targets cannot be built with diff --git a/core/soong_config.mk b/core/soong_config.mk index 18949bef2..86d26fd6a 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -113,8 +113,12 @@ $(call add_json_str, TidyChecks, $(WITH_TIDY_CHECKS)) $(call add_json_bool, NativeLineCoverage, $(filter true,$(NATIVE_LINE_COVERAGE))) $(call add_json_bool, Native_coverage, $(filter true,$(NATIVE_COVERAGE))) $(call add_json_bool, ClangCoverage, $(filter true,$(CLANG_COVERAGE))) -$(call add_json_list, CoveragePaths, $(COVERAGE_PATHS)) -$(call add_json_list, CoverageExcludePaths, $(COVERAGE_EXCLUDE_PATHS)) +# TODO(b/158212027): Remove `$(COVERAGE_PATHS)` from this list when all users have been moved to +# `NATIVE_COVERAGE_PATHS`. +$(call add_json_list, NativeCoveragePaths, $(COVERAGE_PATHS) $(NATIVE_COVERAGE_PATHS)) +# TODO(b/158212027): Remove `$(COVERAGE_EXCLUDE_PATHS)` from this list when all users have been +# moved to `NATIVE_COVERAGE_EXCLUDE_PATHS`. +$(call add_json_list, NativeCoverageExcludePaths, $(COVERAGE_EXCLUDE_PATHS) $(NATIVE_COVERAGE_EXCLUDE_PATHS)) $(call add_json_bool, SamplingPGO, $(filter true,$(SAMPLING_PGO)))