Add ctx to AndroidMkExtraEntriesFunc
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.
Bug: 180540739
Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
diff --git a/android/androidmk_test.go b/android/androidmk_test.go
index 347b92e..2f568fb 100644
--- a/android/androidmk_test.go
+++ b/android/androidmk_test.go
@@ -137,9 +137,9 @@
return module
}
-// buildConfigAndCustomModuleFoo creates a config object, processes the supplied
+// buildContextAndCustomModuleFoo creates a config object, processes the supplied
// bp module and then returns the config and the custom module called "foo".
-func buildConfigAndCustomModuleFoo(t *testing.T, bp string) (Config, *customModule) {
+func buildContextAndCustomModuleFoo(t *testing.T, bp string) (*TestContext, *customModule) {
t.Helper()
config := TestConfig(buildDir, nil, bp, nil)
config.katiEnabled = true // Enable androidmk Singleton
@@ -155,7 +155,7 @@
FailIfErrored(t, errs)
module := ctx.ModuleForTests("foo", "").Module().(*customModule)
- return config, module
+ return ctx, module
}
func TestAndroidMkSingleton_PassesUpdatedAndroidMkDataToCustomCallback(t *testing.T) {
@@ -168,7 +168,7 @@
}
`
- _, m := buildConfigAndCustomModuleFoo(t, bp)
+ _, m := buildContextAndCustomModuleFoo(t, bp)
assertEqual := func(expected interface{}, actual interface{}) {
if !reflect.DeepEqual(expected, actual) {
@@ -253,8 +253,8 @@
"$(call dist-for-goals,my_goal my_other_goal,three/four.out:four.out)\n",
}
- config, module := buildConfigAndCustomModuleFoo(t, bp)
- entries := AndroidMkEntriesForTest(t, config, "", module)
+ ctx, module := buildContextAndCustomModuleFoo(t, bp)
+ entries := AndroidMkEntriesForTest(t, ctx, module)
if len(entries) != 1 {
t.Errorf("Expected a single AndroidMk entry, got %d", len(entries))
}
@@ -343,8 +343,8 @@
t.Run(name, func(t *testing.T) {
t.Helper()
- config, module := buildConfigAndCustomModuleFoo(t, bp)
- entries := AndroidMkEntriesForTest(t, config, "", module)
+ ctx, module := buildContextAndCustomModuleFoo(t, bp)
+ entries := AndroidMkEntriesForTest(t, ctx, module)
if len(entries) != 1 {
t.Errorf("Expected a single AndroidMk entry, got %d", len(entries))
}