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
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user