diff options
author | 2023-11-02 16:56:39 -0700 | |
---|---|---|
committer | 2023-12-03 17:22:56 -0800 | |
commit | f61d03d241334e355216e46fecb06a84e8626f8a (patch) | |
tree | b0cb060a6bf37e655bd8362adc9bd8b94e4feb55 /java/java_test.go | |
parent | 5c1d5fb21b19d6bcc8b0f83bc68124c21b31fabc (diff) |
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
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
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) |