summaryrefslogtreecommitdiff
path: root/java/lint_test.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-01-04 20:00:58 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-01-04 20:00:58 +0000
commit5cb14e12d28fd859a68a0efac992e602ae594bb6 (patch)
tree955849a46cab5e57cc4b55b5eb035402b63ab7d7 /java/lint_test.go
parent1f1662217a384b6d7b117a529a12cfbfa2994272 (diff)
parentb765d6bd460dba905ada40be8e89db699232d569 (diff)
Merge "Don't implicitly pick up lint-baseline.xml" into main
Diffstat (limited to 'java/lint_test.go')
-rw-r--r--java/lint_test.go28
1 files changed, 3 insertions, 25 deletions
diff --git a/java/lint_test.go b/java/lint_test.go
index 5e6b8bcea..b7e6aad8e 100644
--- a/java/lint_test.go
+++ b/java/lint_test.go
@@ -21,7 +21,7 @@ import (
"android/soong/android"
)
-func TestJavaLint(t *testing.T) {
+func TestJavaLintDoesntUseBaselineImplicitly(t *testing.T) {
ctx, _ := testJavaWithFS(t, `
java_library {
name: "foo",
@@ -40,30 +40,8 @@ func TestJavaLint(t *testing.T) {
foo := ctx.ModuleForTests("foo", "android_common")
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")
- }
-}
-
-func TestJavaLintWithoutBaseline(t *testing.T) {
- ctx, _ := testJavaWithFS(t, `
- java_library {
- name: "foo",
- srcs: [
- "a.java",
- "b.java",
- "c.java",
- ],
- min_sdk_version: "29",
- sdk_version: "system_current",
- }
- `, map[string][]byte{})
-
- foo := ctx.ModuleForTests("foo", "android_common")
-
- 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")
+ if strings.Contains(*sboxProto.Commands[0].Command, "--baseline lint-baseline.xml") {
+ t.Error("Passed --baseline flag when baseline_filename was not set")
}
}