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
This commit is contained in:
committed by
Oliver Nguyen
parent
16e8b0492d
commit
0c9a2d0768
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user