Make filesystem aware of coverage

filesystem should have coverage variants with coverage-enabled build.
Otherwise, it would fail to collect dependencies.

Bug: 273238141
Test: m nothing (soong tests)
Test: compare the artifacts
 $ SKIP_ABI_CHECKS=true SOONG_COLLECT_JAVA_DEPS=true EMMA_INSTRUMENT=true\
   EMMA_INSTRUMENT_FRAMEWORK=true CLANG_COVERAGE=true\
   NATIVE_COVERAGE_PATHS='*' m microdroid
 $ m microdroid
Change-Id: I792458ace00a63b4b5213898fd3209351a6e00be
This commit is contained in:
Jooyung Han
2023-03-16 13:11:17 +09:00
parent 58fa5a3f36
commit e606759ddf
3 changed files with 77 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import (
"strings"
"android/soong/android"
"android/soong/cc"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
@@ -498,3 +499,11 @@ func sha1sum(values []string) string {
}
return fmt.Sprintf("%x", h.Sum(nil))
}
// Base cc.UseCoverage
var _ cc.UseCoverage = (*filesystem)(nil)
func (*filesystem) IsNativeCoverageNeeded(ctx android.BaseModuleContext) bool {
return ctx.Device() && ctx.DeviceConfig().NativeCoverageEnabled()
}