From f61d03d241334e355216e46fecb06a84e8626f8a Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 2 Nov 2023 16:56:39 -0700 Subject: Add TestContext parameter to ContentFromFileRuleForTests The next CL will need a TestContext parameter in ContentFromFileRuleForTests in order to retrieve the file rule contents from the Config. Add it and update all the tests that use it in order to simply review of the next CL. Bug: 306029038 Test: go test ./... Change-Id: Ia4b4c9854017ea3472fa2f8ba42cf7f72720496e --- java/java_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'java/java_test.go') diff --git a/java/java_test.go b/java/java_test.go index 81119a79e..0c750ebe1 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -1921,7 +1921,7 @@ func TestJavaApiLibraryAndProviderLink(t *testing.T) { for _, c := range testcases { m := ctx.ModuleForTests(c.moduleName, "android_common") manifest := m.Output("metalava.sbox.textproto") - sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest) manifestCommand := sboxProto.Commands[0].GetCommand() sourceFilesFlag := "--source-files " + strings.Join(c.sourceTextFileDirs, " ") android.AssertStringDoesContain(t, "source text files not present", manifestCommand, sourceFilesFlag) @@ -2026,7 +2026,7 @@ func TestJavaApiLibraryAndDefaultsLink(t *testing.T) { for _, c := range testcases { m := ctx.ModuleForTests(c.moduleName, "android_common") manifest := m.Output("metalava.sbox.textproto") - sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest) manifestCommand := sboxProto.Commands[0].GetCommand() sourceFilesFlag := "--source-files " + strings.Join(c.sourceTextFileDirs, " ") android.AssertStringDoesContain(t, "source text files not present", manifestCommand, sourceFilesFlag) @@ -2316,7 +2316,7 @@ func TestJavaApiLibraryFullApiSurfaceStub(t *testing.T) { m := ctx.ModuleForTests("bar1", "android_common") manifest := m.Output("metalava.sbox.textproto") - sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest) manifestCommand := sboxProto.Commands[0].GetCommand() android.AssertStringDoesContain(t, "Command expected to contain full_api_surface_stub output jar", manifestCommand, "lib1.jar") } @@ -2480,7 +2480,7 @@ func TestJavaApiContributionImport(t *testing.T) { `) m := ctx.ModuleForTests("foo", "android_common") manifest := m.Output("metalava.sbox.textproto") - sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx.TestContext, manifest) manifestCommand := sboxProto.Commands[0].GetCommand() sourceFilesFlag := "--source-files current.txt" android.AssertStringDoesContain(t, "source text files not present", manifestCommand, sourceFilesFlag) @@ -2501,7 +2501,7 @@ func TestJavaApiLibraryApiFilesSorting(t *testing.T) { `) m := ctx.ModuleForTests("foo", "android_common") manifest := m.Output("metalava.sbox.textproto") - sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, manifest) manifestCommand := sboxProto.Commands[0].GetCommand() // Api files are sorted from the narrowest api scope to the widest api scope. @@ -2543,7 +2543,7 @@ func TestSdkLibraryProvidesSystemModulesToApiLibrary(t *testing.T) { `) m := result.ModuleForTests(apiScopePublic.apiLibraryModuleName("foo"), "android_common") manifest := m.Output("metalava.sbox.textproto") - sboxProto := android.RuleBuilderSboxProtoForTests(t, manifest) + sboxProto := android.RuleBuilderSboxProtoForTests(t, result.TestContext, manifest) manifestCommand := sboxProto.Commands[0].GetCommand() classPathFlag := "--classpath __SBOX_SANDBOX_DIR__/out/.intermediates/bar/android_common/turbine-combined/bar.jar" android.AssertStringDoesContain(t, "command expected to contain classpath flag", manifestCommand, classPathFlag) -- cgit v1.2.3-59-g8ed1b