1// Copyright 2019 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// Set of error prone rules to ensure code quality 16// PackageLocation check requires the androidCompatible=false otherwise it does not do anything. 17package { 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21java_library_host { 22 name: "atest-tradefed-shell", 23 java_resource_dirs: ["res"], 24} 25 26tradefed_binary_host { 27 name: "atest-tradefed", 28 short_name: "ATEST", 29 full_name: "ATest Test Suite", 30 static_libs: ["atest-tradefed-shell"], 31 required: ["atest_tradefed.sh", "atest_script_help.sh"], 32} 33 34// Attributes common to both atest and atest_flag_list_generator. 35python_defaults { 36 name: "atest_defaults", 37 pkg_path: "atest", 38 srcs: [ 39 "**/*.py", 40 ], 41 exclude_srcs: [ 42 "*_unittest.py", 43 "*/*_unittest.py", 44 "asuite_lib_test/*.py", 45 "proto/*.py", 46 "tf_proto/*.py", 47 ], 48 libs: [ 49 "asuite_proto", 50 "tradefed-protos-py", 51 "py-google-api-python-client", 52 "py-oauth2client", 53 ], 54 data: [ 55 "bazel/resources/**/*", 56 ], 57} 58 59python_binary_host { 60 name: "atest", 61 defaults: ["atest_defaults"], 62 main: "atest_main.py", 63 data: [ 64 ":atest_flag_list_for_completion", 65 ], 66 // Make atest's built name be atest-dev 67 stem: "atest-dev", 68 dist: { 69 targets: ["droidcore"], 70 }, 71} 72 73// A helper binary used to generate the atest_flag_list_for_completion.txt 74// file, it should never be run outside of the build. It's the same 75// as atest except it has atest_flag_list_generator.py as it's main python 76// file. The atest_flag_list_for_completion.txt file is extracted from the 77// atest binary during autocompletion. 78python_binary_host { 79 name: "atest_flag_list_generator", 80 defaults: ["atest_defaults"], 81 main: "atest_flag_list_generator.py", 82} 83 84genrule { 85 name: "atest_flag_list_for_completion", 86 out: ["atest_flag_list_for_completion.txt"], 87 tools: ["atest_flag_list_generator"], 88 cmd: "$(location atest_flag_list_generator) > $(out)", 89} 90 91python_library_host { 92 name: "atest_module_info", 93 pkg_path: "atest", 94 srcs: [ 95 "atest_error.py", 96 "atest_decorator.py", 97 "atest_utils.py", 98 "constants.py", 99 "constants_default.py", 100 "module_info.py", 101 ], 102 libs: [ 103 "tradefed-protos-py", 104 ], 105} 106 107python_library_host { 108 name: "asuite_cc_client", 109 pkg_path: "atest", 110 srcs: [ 111 "atest_enum.py", 112 "asuite_metrics.py", 113 "metrics/*.py", 114 "coverage/*.py", 115 ], 116 libs: [ 117 "asuite_proto", 118 "atest_module_info", 119 ], 120} 121 122python_test_host { 123 name: "atest_unittests", 124 main: "atest_run_unittests.py", 125 pkg_path: "atest", 126 srcs: [ 127 "**/*.py", 128 ], 129 test_options: { 130 unit_test: true, 131 }, 132 data: [ 133 "unittest_data/**/*", 134 "unittest_data/**/.*", 135 ], 136 exclude_srcs: [ 137 "asuite_lib_test/*.py", 138 "tools/atest_updatedb_unittest.py", 139 "proto/*.py", 140 "tf_proto/*.py", 141 ], 142 libs: [ 143 "asuite_proto", 144 "pyfakefs", 145 "tradefed-protos-py", 146 ], 147 test_config: "atest_unittests.xml", 148 test_suites: ["general-tests"], 149} 150 151python_test_host { 152 name: "atest_integration_tests", 153 main: "atest_integration_tests.py", 154 pkg_path: "atest", 155 srcs: [ 156 "atest_integration_tests.py", 157 ], 158 data: [ 159 "test_plans/INTEGRATION_TESTS", 160 ], 161 test_config: "atest_integration_tests.xml", 162 test_suites: ["null-suite"], 163 test_options: { 164 unit_test: false, 165 }, 166} 167 168sh_binary_host { 169 name: "atest_tradefed.sh", 170 src: "atest_tradefed.sh", 171} 172 173sh_binary_host { 174 name: "atest_script_help.sh", 175 src: "atest_script_help.sh", 176} 177