Enable Android Lint tests for AndroidFrameworkLintChecker
Create AndroidFrameworkLintCheckerTest module and add
.allowMissingSdk(true) to all tests to enable tests running on gerrit.
"unit_test: true" marks the module as a unit test target which runs it
on the host without a device and it automatically gets onboarded in the
presubmit.
Bug: 157626959
Test: atest AndroidFrameworkLintCheckerTest --host
Change-Id: I66c6e331e72dfca45d341a49eb43fbd73ccd28ff
diff --git a/tools/lint/Android.bp b/tools/lint/Android.bp
index dcbc32b..17547ef 100644
--- a/tools/lint/Android.bp
+++ b/tools/lint/Android.bp
@@ -31,16 +31,16 @@
],
}
-// TODO: (b/162368644) Implement these (working in gradle) Kotlin Tests to run on Soong
-//java_test_host {
-// name: "AndroidFrameworkLintCheckerTest",
-// srcs: [
-// "checks/src/test/java/**/*.kt",
-// "checks/src/main/java/**/*.kt",
-// ],
-// plugins: ["auto_service_plugin"],
-// static_libs: [
-// "auto_service_annotations",
-// "lint_api",
-// ],
-//}
+java_test_host {
+ name: "AndroidFrameworkLintCheckerTest",
+ srcs: ["checks/src/test/java/**/*.kt"],
+ static_libs: [
+ "AndroidFrameworkLintChecker",
+ "junit",
+ "lint",
+ "lint_tests",
+ ],
+ test_options: {
+ unit_test: true,
+ },
+}