1// Copyright (C) 2023 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15// Integration tests for @EnforcePermission linters. 16// Each test defines its own java_library. The XML lint report from this 17// java_library is wrapped under a Python library with a unique pkg_path (this 18// is to avoid a name conflict for the report file). All the tests are 19// referenced and executed by AndroidGlobalLintCheckerIntegrationTest. 20 21java_defaults { 22 name: "AndroidGlobalLintIntegrationTestDefault", 23 libs: [ 24 "framework-annotations-lib", 25 ], 26 lint: { 27 // It is expected that lint returns an error when processing the 28 // library. Silence it here, the lint output is verified in tests.py. 29 suppress_exit_code: true, 30 }, 31} 32 33java_library { 34 name: "AndroidGlobalLintTestNoAidl", 35 srcs: ["TestNoAidl/**/*.java"], 36 defaults: ["AndroidGlobalLintIntegrationTestDefault"], 37} 38 39python_library_host { 40 name: "AndroidGlobalLintTestNoAidl_py", 41 data: [":AndroidGlobalLintTestNoAidl{.lint}"], 42 pkg_path: "no_aidl", 43} 44 45java_library { 46 name: "AndroidGlobalLintTestMissingAnnotation", 47 srcs: [ 48 "TestMissingAnnotation/**/*.java", 49 "TestMissingAnnotation/**/*.aidl", 50 ], 51 defaults: ["AndroidGlobalLintIntegrationTestDefault"], 52} 53 54python_library_host { 55 name: "AndroidGlobalLintTestMissingAnnotation_py", 56 data: [":AndroidGlobalLintTestMissingAnnotation{.lint}"], 57 pkg_path: "missing_annotation", 58} 59 60python_test_host { 61 name: "AndroidGlobalLintCheckerIntegrationTest", 62 srcs: ["tests.py"], 63 main: "tests.py", 64 libs: [ 65 "AndroidGlobalLintTestNoAidl_py", 66 "AndroidGlobalLintTestMissingAnnotation_py", 67 ], 68 version: { 69 py3: { 70 embedded_launcher: true, 71 }, 72 }, 73} 74