• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
15python_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
30// 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
46python_binary_host {
47    name: "atest",
48    main: "atest.py",
49    srcs: [
50        "**/*.py",
51    ],
52    exclude_srcs: [
53        "*_unittest.py",
54        "*/*_unittest.py",
55        "proto/*_pb2.py",
56        "proto/__init__.py",
57    ],
58    libs: [
59        "atest_proto",
60    ],
61    // Make atest's built name to atest-dev
62    stem: "atest-dev",
63    defaults: ["atest_py2_default"],
64}
65
66python_library_host {
67    name: "atest_module_info",
68    defaults: ["atest_lib_default"],
69    srcs: [
70        "module_info.py",
71        "atest_utils.py",
72        "constants.py",
73        "constants_default.py"
74    ],
75}
76
77// Move asuite_default and asuite_metrics to //tools/asuite when atest is
78// running as a prebuilt.
79python_defaults {
80    name: "asuite_default",
81    pkg_path: "asuite",
82    version: {
83        py2: {
84            enabled: true,
85            embedded_launcher: false,
86        },
87        py3: {
88            enabled: true,
89            embedded_launcher: false,
90        },
91    },
92}
93
94python_library_host {
95    name: "asuite_metrics",
96    defaults: ["asuite_default"],
97    srcs: [
98        "asuite_metrics.py",
99    ],
100}
101
102python_test_host {
103    name: "atest_unittests",
104    main: "atest_run_unittests.py",
105    pkg_path: "atest",
106    srcs: [
107        "**/*.py",
108    ],
109    data: [
110        "unittest_data/**/*",
111        "unittest_data/**/.*",
112    ],
113    exclude_srcs: [
114        "proto/*_pb2.py",
115        "proto/__init__.py",
116    ],
117    libs: [
118        "py-mock",
119        "atest_proto",
120    ],
121    test_config: "atest_unittests.xml",
122    test_suites: ["general-tests"],
123    defaults: ["atest_py2_default"],
124}
125
126python_test_host {
127    name: "atest_integration_tests",
128    main: "atest_integration_tests.py",
129    pkg_path: "atest",
130    srcs: [
131        "atest_integration_tests.py",
132    ],
133    data: [
134        "INTEGRATION_TESTS",
135    ],
136    test_config: "atest_integration_tests.xml",
137    test_suites: ["general-tests"],
138    defaults: ["atest_py2_default"],
139}
140
141python_library_host {
142    name: "atest_proto",
143    defaults: ["atest_py2_default"],
144    srcs: [
145        "proto/*.proto",
146    ],
147    proto: {
148        canonical_path_from_root: false,
149    },
150}
151
152java_library_host {
153    name: "asuite_proto_java",
154    srcs: [
155        "proto/*.proto",
156    ],
157    libs: [
158        "libprotobuf-java-full",
159    ],
160    proto: {
161        canonical_path_from_root: false,
162        include_dirs: ["external/protobuf/src"],
163    },
164}
165
166python_library_host {
167    name: "asuite_proto",
168    defaults: ["asuite_default"],
169    srcs: [
170        "proto/*.proto",
171    ],
172    proto: {
173        canonical_path_from_root: false,
174    },
175}
176
177python_library_host {
178    name: "asuite_cc_client",
179    defaults: ["asuite_default"],
180    srcs: [
181        "atest_utils.py",
182        "constants.py",
183        "constants_default.py",
184        "metrics/*.py",
185    ],
186    libs: [
187        "asuite_proto",
188        "asuite_metrics",
189    ],
190}
191