Merge SingletonProviderContext with OtherModuleProviderContext
Bug: 358425833
Test: CI
Change-Id: I8e3f40dc3cfc5337008b419801f8e6bf2d48e8b2
diff --git a/cc/cc_test.go b/cc/cc_test.go
index 7372fff..779e53d 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -851,7 +851,7 @@
variant := "android_arm64_armv8-a_static"
moduleA := ctx.ModuleForTests("a", variant).Module().(*Module)
- staticLibInfo, _ := android.SingletonModuleProvider(ctx, moduleA, StaticLibraryInfoProvider)
+ staticLibInfo, _ := android.OtherModuleProvider(ctx, moduleA, StaticLibraryInfoProvider)
actual := android.Paths(staticLibInfo.TransitiveStaticLibrariesForOrdering.ToList()).RelativeToTop()
expected := GetOutputPaths(ctx, variant, []string{"a", "c", "b", "d"})
@@ -887,7 +887,7 @@
variant := "android_arm64_armv8-a_static"
moduleA := ctx.ModuleForTests("a", variant).Module().(*Module)
- staticLibInfo, _ := android.SingletonModuleProvider(ctx, moduleA, StaticLibraryInfoProvider)
+ staticLibInfo, _ := android.OtherModuleProvider(ctx, moduleA, StaticLibraryInfoProvider)
actual := android.Paths(staticLibInfo.TransitiveStaticLibrariesForOrdering.ToList()).RelativeToTop()
expected := GetOutputPaths(ctx, variant, []string{"a", "c", "b"})
@@ -999,7 +999,7 @@
checkExportedIncludeDirs := func(module, variant string, expectedSystemDirs []string, expectedDirs ...string) {
t.Helper()
m := result.ModuleForTests(module, variant).Module()
- f, _ := android.SingletonModuleProvider(result, m, FlagExporterInfoProvider)
+ f, _ := android.OtherModuleProvider(result, m, FlagExporterInfoProvider)
android.AssertPathsRelativeToTopEquals(t, "exported include dirs for "+module+"["+variant+"]",
expectedDirs, f.IncludeDirs)
android.AssertPathsRelativeToTopEquals(t, "exported include dirs for "+module+"["+variant+"]",
@@ -1027,7 +1027,7 @@
}
}
vendorModule := result.ModuleForTests(module, vendorVariant).Module()
- vendorInfo, _ := android.SingletonModuleProvider(result, vendorModule, FlagExporterInfoProvider)
+ vendorInfo, _ := android.OtherModuleProvider(result, vendorModule, FlagExporterInfoProvider)
vendorDirs := android.Concat(vendorInfo.IncludeDirs, vendorInfo.SystemIncludeDirs)
android.AssertStringEquals(t, module+" has different exported include dirs for vendor variant and ABI check",
android.JoinPathsWithPrefix(vendorDirs, "-I"), abiCheckFlags)
@@ -2452,7 +2452,7 @@
checkIncludeDirs := func(t *testing.T, ctx *android.TestContext, module android.Module, checkers ...exportedChecker) {
t.Helper()
- exported, _ := android.SingletonModuleProvider(ctx, module, FlagExporterInfoProvider)
+ exported, _ := android.OtherModuleProvider(ctx, module, FlagExporterInfoProvider)
name := module.Name()
for _, checker := range checkers {
diff --git a/cc/sanitize_test.go b/cc/sanitize_test.go
index 44f38e1..80facd8 100644
--- a/cc/sanitize_test.go
+++ b/cc/sanitize_test.go
@@ -47,7 +47,7 @@
`))
type providerInterface interface {
- android.SingletonModuleProviderContext
+ android.OtherModuleProviderContext
}
// expectSharedLinkDep verifies that the from module links against the to module as a
@@ -55,7 +55,7 @@
func expectSharedLinkDep(t *testing.T, ctx providerInterface, from, to android.TestingModule) {
t.Helper()
fromLink := from.Description("link")
- toInfo, _ := android.SingletonModuleProvider(ctx, to.Module(), SharedLibraryInfoProvider)
+ toInfo, _ := android.OtherModuleProvider(ctx, to.Module(), SharedLibraryInfoProvider)
if g, w := fromLink.OrderOnly.Strings(), toInfo.SharedLibrary.RelativeToTop().String(); !android.InList(w, g) {
t.Errorf("%s should link against %s, expected %q, got %q",
@@ -68,7 +68,7 @@
func expectNoSharedLinkDep(t *testing.T, ctx providerInterface, from, to android.TestingModule) {
t.Helper()
fromLink := from.Description("link")
- toInfo, _ := android.SingletonModuleProvider(ctx, to.Module(), SharedLibraryInfoProvider)
+ toInfo, _ := android.OtherModuleProvider(ctx, to.Module(), SharedLibraryInfoProvider)
if g, w := fromLink.OrderOnly.Strings(), toInfo.SharedLibrary.RelativeToTop().String(); android.InList(w, g) {
t.Errorf("%s should not link against %s, expected %q, got %q",
@@ -81,7 +81,7 @@
func expectStaticLinkDep(t *testing.T, ctx providerInterface, from, to android.TestingModule) {
t.Helper()
fromLink := from.Description("link")
- toInfo, _ := android.SingletonModuleProvider(ctx, to.Module(), StaticLibraryInfoProvider)
+ toInfo, _ := android.OtherModuleProvider(ctx, to.Module(), StaticLibraryInfoProvider)
if g, w := fromLink.Implicits.Strings(), toInfo.StaticLibrary.RelativeToTop().String(); !android.InList(w, g) {
t.Errorf("%s should link against %s, expected %q, got %q",
@@ -95,7 +95,7 @@
func expectNoStaticLinkDep(t *testing.T, ctx providerInterface, from, to android.TestingModule) {
t.Helper()
fromLink := from.Description("link")
- toInfo, _ := android.SingletonModuleProvider(ctx, to.Module(), StaticLibraryInfoProvider)
+ toInfo, _ := android.OtherModuleProvider(ctx, to.Module(), StaticLibraryInfoProvider)
if g, w := fromLink.Implicits.Strings(), toInfo.StaticLibrary.RelativeToTop().String(); android.InList(w, g) {
t.Errorf("%s should not link against %s, expected %q, got %q",