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/lint_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'java/lint_test.go') diff --git a/java/lint_test.go b/java/lint_test.go index ec901aa70..5e6b8bcea 100644 --- a/java/lint_test.go +++ b/java/lint_test.go @@ -39,7 +39,7 @@ func TestJavaLint(t *testing.T) { foo := ctx.ModuleForTests("foo", "android_common") - sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto")) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, foo.Output("lint.sbox.textproto")) if !strings.Contains(*sboxProto.Commands[0].Command, "--baseline lint-baseline.xml") { t.Error("did not pass --baseline flag") } @@ -61,7 +61,7 @@ func TestJavaLintWithoutBaseline(t *testing.T) { foo := ctx.ModuleForTests("foo", "android_common") - sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto")) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, foo.Output("lint.sbox.textproto")) if strings.Contains(*sboxProto.Commands[0].Command, "--baseline") { t.Error("passed --baseline flag for non existent file") } @@ -108,7 +108,7 @@ func TestJavaLintUsesCorrectBpConfig(t *testing.T) { foo := ctx.ModuleForTests("foo", "android_common") - sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto")) + sboxProto := android.RuleBuilderSboxProtoForTests(t, ctx, foo.Output("lint.sbox.textproto")) if !strings.Contains(*sboxProto.Commands[0].Command, "--baseline mybaseline.xml") { t.Error("did not use the correct file for baseline") } @@ -276,7 +276,7 @@ func TestJavaLintDatabaseSelectionFull(t *testing.T) { RunTestWithBp(t, thisBp) foo := result.ModuleForTests("foo", "android_common") - sboxProto := android.RuleBuilderSboxProtoForTests(t, foo.Output("lint.sbox.textproto")) + sboxProto := android.RuleBuilderSboxProtoForTests(t, result.TestContext, foo.Output("lint.sbox.textproto")) if !strings.Contains(*sboxProto.Commands[0].Command, "/"+testCase.expected_file) { t.Error("did not use full api database for case", testCase) } -- cgit v1.2.3-59-g8ed1b