summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorPedro Loureiro <pedroql@google.com>2021-02-25 16:23:22 +0000
committerPedro Loureiro <pedroql@google.com>2021-04-13 15:19:02 +0000
commitf4a88b163358de203f9346be2d04567a0acf767d (patch)
tree598bd104619a9e2fc7fe98af503e80f06e19a770 /java/java_test.go
parent4f3e58c031795df55bfc764173a1e3dd3644c0eb (diff)
Introduce NewApi lint checks
We are enabling NewApi lint check where the min sdk != compile sdk. At the same time, we are introducing baseline files for existing projects that fail this check in order to keep the build running. At the very least we stop introducing new problems and teams might realise of risks in their projects they were not aware of. Bug: 150847901 Test: m lint-check Change-Id: Icfa5eb98cc6b6708149f0c52fac8fc1440d9c3b0 Merged-In: Icfa5eb98cc6b6708149f0c52fac8fc1440d9c3b0
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index fdf757902..052345871 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1261,6 +1261,14 @@ func TestJavaLintUsesCorrectBpConfig(t *testing.T) {
if !strings.Contains(*sboxProto.Commands[0].Command, "--baseline mybaseline.xml") {
t.Error("did not use the correct file for baseline")
}
+
+ if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check NewApi") {
+ t.Error("should check NewApi errors")
+ }
+
+ if !strings.Contains(*sboxProto.Commands[0].Command, "--error_check SomeCheck") {
+ t.Error("should combine NewApi errors with SomeCheck errors")
+ }
}
func TestGeneratedSources(t *testing.T) {