blob: 4491b63642ae153668cad4ec35451f136dfab104 [file] [log] [blame]
Jim Tangec94b162018-05-04 07:17:23 +00001// Copyright (C) 2018 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
yangbill78ef63e2018-08-31 00:11:25 +080015python_defaults {
16 name: "atest_lib_default",
17 pkg_path: "atest",
18 version: {
19 py2: {
20 enabled: false,
21 embedded_launcher: false,
22 },
23 py3: {
24 enabled: true,
25 embedded_launcher: false,
26 },
27 },
28}
29
yangbill7a481202018-10-23 16:20:02 +080030// Remove this defaults after python3 migration is finished.
31python_defaults {
32 name: "atest_py2_default",
33 pkg_path: "atest",
34 version: {
35 py2: {
36 enabled: true,
37 embedded_launcher: false,
38 },
39 py3: {
40 enabled: false,
41 embedded_launcher: false,
42 },
43 },
44}
45
Jim Tangec94b162018-05-04 07:17:23 +000046python_binary_host {
47 name: "atest",
48 main: "atest.py",
49 srcs: [
50 "**/*.py",
51 ],
52 exclude_srcs: [
53 "*_unittest.py",
54 "*/*_unittest.py",
yangbill763f5ff2019-05-07 14:13:42 +080055 "asuite_lib_test/*.py",
yangbill58db2712019-02-14 13:59:42 +080056 "proto/*_pb2.py",
kellyhung710ce962018-11-16 14:30:39 +080057 "proto/__init__.py",
Jim Tangec94b162018-05-04 07:17:23 +000058 ],
Jim Tangae8eb442018-10-29 16:42:33 +080059 libs: [
yangbill58db2712019-02-14 13:59:42 +080060 "atest_proto",
Jim Tangae8eb442018-10-29 16:42:33 +080061 ],
Jim Tangcb711052019-05-08 16:38:25 +080062 data: [
63 "tools/updatedb_darwin.sh",
Jim Tang139389a2019-09-27 14:48:30 +080064 ":asuite_version",
Jim Tangcb711052019-05-08 16:38:25 +080065 ],
yangbill58db2712019-02-14 13:59:42 +080066 // Make atest's built name to atest-dev
67 stem: "atest-dev",
yangbill7a481202018-10-23 16:20:02 +080068 defaults: ["atest_py2_default"],
Colin Cross47d81f42019-10-18 15:45:27 -070069 dist: {
70 targets: ["droidcore"],
71 },
Jim Tangec94b162018-05-04 07:17:23 +000072}
yangbill78ef63e2018-08-31 00:11:25 +080073
74python_library_host {
75 name: "atest_module_info",
76 defaults: ["atest_lib_default"],
77 srcs: [
yangbillbac1dd62019-06-03 17:06:40 +080078 "atest_error.py",
yelinhsieh686cda92019-09-11 15:21:42 +080079 "atest_decorator.py",
yangbill78ef63e2018-08-31 00:11:25 +080080 "atest_utils.py",
81 "constants.py",
yangbillbac1dd62019-06-03 17:06:40 +080082 "constants_default.py",
83 "module_info.py",
yangbill78ef63e2018-08-31 00:11:25 +080084 ],
85}
Kevin Cheng5d6e1572018-10-23 11:43:42 -070086
87// Move asuite_default and asuite_metrics to //tools/asuite when atest is
88// running as a prebuilt.
89python_defaults {
90 name: "asuite_default",
91 pkg_path: "asuite",
92 version: {
93 py2: {
94 enabled: true,
95 embedded_launcher: false,
96 },
97 py3: {
98 enabled: true,
99 embedded_launcher: false,
100 },
101 },
102}
103
104python_library_host {
105 name: "asuite_metrics",
106 defaults: ["asuite_default"],
107 srcs: [
108 "asuite_metrics.py",
109 ],
110}
Jim Tangae8eb442018-10-29 16:42:33 +0800111
Jim Tangcb711052019-05-08 16:38:25 +0800112// Exclude atest_updatedb_unittest due to it's a test for ATest's wrapper of updatedb, but there's
113// no updatedb binary on test server.
Jim Tangae8eb442018-10-29 16:42:33 +0800114python_test_host {
115 name: "atest_unittests",
116 main: "atest_run_unittests.py",
117 pkg_path: "atest",
118 srcs: [
119 "**/*.py",
120 ],
121 data: [
Jim Tangcb711052019-05-08 16:38:25 +0800122 "tools/updatedb_darwin.sh",
Jim Tangae8eb442018-10-29 16:42:33 +0800123 "unittest_data/**/*",
124 "unittest_data/**/.*",
125 ],
kellyhung710ce962018-11-16 14:30:39 +0800126 exclude_srcs: [
yangbill763f5ff2019-05-07 14:13:42 +0800127 "asuite_lib_test/*.py",
kellyhung710ce962018-11-16 14:30:39 +0800128 "proto/*_pb2.py",
129 "proto/__init__.py",
Jim Tangcb711052019-05-08 16:38:25 +0800130 "tools/atest_updatedb_unittest.py",
kellyhung710ce962018-11-16 14:30:39 +0800131 ],
132 libs: [
133 "py-mock",
134 "atest_proto",
135 ],
Jim Tangae8eb442018-10-29 16:42:33 +0800136 test_config: "atest_unittests.xml",
137 test_suites: ["general-tests"],
138 defaults: ["atest_py2_default"],
139}
kellyhung710ce962018-11-16 14:30:39 +0800140
easoncylee297d3fa2018-08-21 17:52:56 +0800141python_test_host {
142 name: "atest_integration_tests",
143 main: "atest_integration_tests.py",
144 pkg_path: "atest",
145 srcs: [
146 "atest_integration_tests.py",
147 ],
148 data: [
149 "INTEGRATION_TESTS",
150 ],
151 test_config: "atest_integration_tests.xml",
152 test_suites: ["general-tests"],
153 defaults: ["atest_py2_default"],
154}
155
kellyhung710ce962018-11-16 14:30:39 +0800156python_library_host {
157 name: "atest_proto",
158 defaults: ["atest_py2_default"],
159 srcs: [
160 "proto/*.proto",
161 ],
162 proto: {
163 canonical_path_from_root: false,
164 },
165}
kellyhung5161d932019-04-23 16:23:59 +0800166
Julien Desprezf7f52e82019-05-24 13:33:10 -0700167java_library_host {
168 name: "asuite_proto_java",
169 srcs: [
170 "proto/*.proto",
171 ],
172 libs: [
173 "libprotobuf-java-full",
174 ],
175 proto: {
176 canonical_path_from_root: false,
177 include_dirs: ["external/protobuf/src"],
178 },
179}
180
kellyhung5161d932019-04-23 16:23:59 +0800181python_library_host {
182 name: "asuite_proto",
183 defaults: ["asuite_default"],
184 srcs: [
185 "proto/*.proto",
186 ],
187 proto: {
188 canonical_path_from_root: false,
189 },
190}
191
192python_library_host {
193 name: "asuite_cc_client",
194 defaults: ["asuite_default"],
195 srcs: [
yangbillbac1dd62019-06-03 17:06:40 +0800196 "atest_error.py",
yelinhsieh686cda92019-09-11 15:21:42 +0800197 "atest_decorator.py",
kellyhung5161d932019-04-23 16:23:59 +0800198 "atest_utils.py",
199 "constants.py",
200 "constants_default.py",
201 "metrics/*.py",
202 ],
203 libs: [
204 "asuite_proto",
205 "asuite_metrics",
206 ],
207}
yangbill763f5ff2019-05-07 14:13:42 +0800208
Jim Tang139389a2019-09-27 14:48:30 +0800209
210genrule {
211 name: "asuite_version",
212 cmd: "DATETIME=$$(TZ='America/Log_Angelos' date +'%F');" +
213 "if [[ -n $$BUILD_NUMBER ]]; then" +
214 " echo $${DATETIME}_$${BUILD_NUMBER} > $(out);" +
215 "else" +
216 " echo $$(date +'%F_%R') > $(out);" +
217 "fi",
218 out: [
219 "VERSION",
220 ],
221}