diff options
author | Roland Levillain <rpl@google.com> | 2020-06-09 12:44:06 +0100 |
---|---|---|
committer | Oliver Nguyen <olivernguyen@google.com> | 2020-06-30 14:48:18 -0700 |
commit | 0c9a2d07682f1e5a4b1e10f27ebcb7dec1038fd2 (patch) | |
tree | 35f8e179ec049082bc1c6b8317b41f8897e03fa8 /android | |
parent | 16e8b0492d25772c5fdae76265a1830c147dcf2e (diff) | |
download | build_soong-0c9a2d07682f1e5a4b1e10f27ebcb7dec1038fd2.tar.gz build_soong-0c9a2d07682f1e5a4b1e10f27ebcb7dec1038fd2.tar.bz2 build_soong-0c9a2d07682f1e5a4b1e10f27ebcb7dec1038fd2.zip |
Rename native code coverage paths product variables in Soong.
Rename `CoveragePath` and `CoverageExcludePaths` as
`NativeCoveragePath` and `NativeCoverageExcludePaths` (resp.).
Also rename function `android.CoverageEnabledForPath` as
`android.NativeCoverageEnabledForPath`.
Test: m nothing
Bug: 158212027
Merged-In: Id2c11a638e88088096420b537effa866d7667304
Change-Id: Id2c11a638e88088096420b537effa866d7667304
Diffstat (limited to 'android')
-rw-r--r-- | android/config.go | 15 | ||||
-rw-r--r-- | android/variable.go | 10 |
2 files changed, 15 insertions, 10 deletions
diff --git a/android/config.go b/android/config.go index 350893ba..92227cd2 100644 --- a/android/config.go +++ b/android/config.go @@ -1049,15 +1049,20 @@ func (c *deviceConfig) ClangCoverageEnabled() bool { return Bool(c.config.productVariables.ClangCoverage) } -func (c *deviceConfig) CoverageEnabledForPath(path string) bool { +// NativeCoverageEnabledForPath returns whether (GCOV- or Clang-based) native +// code coverage is enabled for path. By default, coverage is not enabled for a +// given path unless it is part of the NativeCoveragePaths product variable (and +// not part of the NativeCoverageExcludePaths product variable). Value "*" in +// NativeCoveragePaths represents any path. +func (c *deviceConfig) NativeCoverageEnabledForPath(path string) bool { coverage := false - if c.config.productVariables.CoveragePaths != nil { - if InList("*", c.config.productVariables.CoveragePaths) || HasAnyPrefix(path, c.config.productVariables.CoveragePaths) { + if c.config.productVariables.NativeCoveragePaths != nil { + if InList("*", c.config.productVariables.NativeCoveragePaths) || HasAnyPrefix(path, c.config.productVariables.NativeCoveragePaths) { coverage = true } } - if coverage && c.config.productVariables.CoverageExcludePaths != nil { - if HasAnyPrefix(path, c.config.productVariables.CoverageExcludePaths) { + if coverage && c.config.productVariables.NativeCoverageExcludePaths != nil { + if HasAnyPrefix(path, c.config.productVariables.NativeCoverageExcludePaths) { coverage = false } } diff --git a/android/variable.go b/android/variable.go index 4da33259..277304f7 100644 --- a/android/variable.go +++ b/android/variable.go @@ -253,11 +253,11 @@ type productVariables struct { SamplingPGO *bool `json:",omitempty"` - NativeLineCoverage *bool `json:",omitempty"` - Native_coverage *bool `json:",omitempty"` - ClangCoverage *bool `json:",omitempty"` - CoveragePaths []string `json:",omitempty"` - CoverageExcludePaths []string `json:",omitempty"` + NativeLineCoverage *bool `json:",omitempty"` + Native_coverage *bool `json:",omitempty"` + ClangCoverage *bool `json:",omitempty"` + NativeCoveragePaths []string `json:",omitempty"` + NativeCoverageExcludePaths []string `json:",omitempty"` DevicePrefer32BitApps *bool `json:",omitempty"` DevicePrefer32BitExecutables *bool `json:",omitempty"` |