1// Copyright (C) 2022 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
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19android_test {
20    name: "CtsAdServicesDeviceTestCases",
21    team: "trendy_team_android_rubidium",
22    defaults: ["cts_defaults"],
23    libs: [
24        "android.test.runner",
25        "android.test.base",
26        "framework-adservices-lib",
27        "auto_value_annotations",
28    ],
29    srcs: ["src/**/*.java"],
30    // Tag this module as a cts test artifact
31    exclude_srcs: [
32        "src/android/adservices/debuggablects/*.java",
33        "src/android/adservices/rootcts/*.java",
34    ],
35    test_suites: [
36        "cts",
37        "mts-adservices",
38        "general-tests",
39        "mcts-adservices",
40    ],
41    plugins: [
42        "auto_value_plugin",
43        "auto_annotation_plugin",
44    ],
45    static_libs: [
46        "androidx.test.rules",
47        "androidx.test.ext.junit",
48        "androidx.test.ext.truth",
49        "compatibility-device-util-axt",
50        "ctstestrunner-axt",
51        "cts-wm-util",
52        "adservices-clients",
53        "adservices-test-fixtures",
54        "adservices-test-utility",
55        "testng",
56    ],
57    sdk_version: "module_current",
58    min_sdk_version: "Tiramisu",
59    compile_multilib: "both",
60    lint: {
61        extra_check_modules: ["AdServicesTestLintChecker"],
62        test: false, // TODO(b/343741206): remove when checks will run on android_test
63    },
64}
65
66android_test {
67    name: "CtsAdServicesRootTestCases",
68    defaults: ["cts_defaults"],
69    libs: [
70        "android.test.runner",
71        "android.test.base",
72        "framework-adservices-lib",
73        "auto_value_annotations",
74    ],
75    srcs: [
76        "src/android/adservices/rootcts/*.java",
77        "src/android/adservices/utils/*.java",
78    ],
79    // Tag this module as a cts test artifact
80    exclude_srcs: [
81        "src/android/adservices/debuggablects/*.java",
82        "src/android/adservices/cts/*.java",
83    ],
84    test_suites: [
85        "cts_root",
86        "mts-adservices",
87        "general-tests",
88    ],
89    plugins: [
90        "auto_value_plugin",
91        "auto_annotation_plugin",
92    ],
93    static_libs: [
94        "androidx.test.rules",
95        "androidx.test.ext.junit",
96        "androidx.test.ext.truth",
97        "compatibility-device-util-axt",
98        "ctstestrunner-axt",
99        "cts-wm-util",
100        "adservices-clients",
101        "adservices-test-fixtures",
102        "adservices-test-utility",
103        "testng",
104    ],
105    sdk_version: "module_current",
106    min_sdk_version: "Tiramisu",
107    compile_multilib: "both",
108    manifest: "AndroidManifestRoot.xml",
109    test_config: "AndroidTest.Root.xml",
110    lint: {
111        extra_check_modules: ["AdServicesTestLintChecker"],
112        test: false, // TODO(b/343741206): remove when checks will run on android_test
113    },
114}
115
116android_test {
117    name: "CtsAdExtServicesDeviceTestCases",
118    defaults: ["cts_defaults"],
119    libs: [
120        "android.ext.adservices",
121        "android.test.runner",
122        "android.test.base",
123        "framework-adservices-lib",
124        "auto_value_annotations",
125    ],
126    srcs: ["src/**/*.java"],
127    // Tag this module as a cts test artifact
128    exclude_srcs: [
129        "src/android/adservices/debuggablects/*.java",
130        "src/android/adservices/rootcts/*.java",
131    ],
132    test_suites: [
133        "cts",
134        "mts-extservices",
135        "general-tests",
136        "mcts-extservices",
137    ],
138    plugins: [
139        "auto_value_plugin",
140        "auto_annotation_plugin",
141    ],
142    static_libs: [
143        "androidx.test.rules",
144        "androidx.test.ext.junit",
145        "androidx.test.ext.truth",
146        "compatibility-device-util-axt",
147        "ctstestrunner-axt",
148        "cts-wm-util",
149        "adservices-clients",
150        "adservices-test-fixtures",
151        "adservices-test-utility",
152        "testng",
153    ],
154    sdk_version: "module_current",
155    min_sdk_version: "30",
156    max_sdk_version: "32",
157    test_config: "AndroidTest.ExtServices.xml",
158    manifest: "AndroidManifestExtServices.xml",
159    compile_multilib: "both",
160    lint: {
161        extra_check_modules: ["AdServicesTestLintChecker"],
162        baseline_filename: "lint-baseline-adextservices-devicetestcases.xml",
163        test: false, // TODO(b/343741206): remove when checks will run on android_test
164    },
165}
166
167android_test {
168    name: "CtsAdServicesDebuggableDeviceTestCases",
169    team: "trendy_team_android_rubidium",
170    defaults: ["cts_defaults"],
171    libs: [
172        "android.test.runner",
173        "android.test.base",
174        "framework-adservices-lib",
175    ],
176    srcs: ["src/**/*.java"],
177    // Tag this module as a cts test artifact
178    exclude_srcs: [
179        "src/android/adservices/cts/*.java",
180        "src/android/adservices/rootcts/*.java",
181    ],
182    plugins: [
183        "auto_value_plugin",
184        "auto_annotation_plugin",
185    ],
186    test_suites: [
187        "cts",
188        "mts-adservices",
189        "general-tests",
190        "mcts-adservices",
191    ],
192    static_libs: [
193        "androidx.room_room-runtime",
194        "androidx.room_room-testing",
195        "androidx.test.rules",
196        "androidx.test.ext.junit",
197        "androidx.test.ext.truth",
198        "compatibility-device-util-axt",
199        "ctstestrunner-axt",
200        "cts-wm-util",
201        "adservices-clients",
202        "adservices-test-fixtures",
203        "adservices-test-utility",
204        "mockwebserver",
205        "testng",
206        "auto_value_annotations",
207    ],
208    sdk_version: "module_current",
209    min_sdk_version: "Tiramisu",
210    manifest: "AndroidManifestDebuggable.xml",
211    test_config: "AndroidTestDebuggable.xml",
212    lint: {
213        extra_check_modules: ["AdServicesTestLintChecker"],
214        test: false, // TODO(b/343741206): remove when checks will run on android_test
215    },
216}
217
218android_test {
219    name: "CtsAdExtServicesDebuggableDeviceTestCases",
220    defaults: ["cts_defaults"],
221    libs: [
222        "android.test.runner",
223        "android.test.base",
224        "framework-adservices-lib",
225    ],
226    srcs: ["src/**/*.java"],
227    // Tag this module as a cts test artifact
228    exclude_srcs: [
229        "src/android/adservices/cts/*.java",
230        "src/android/adservices/rootcts/*.java",
231    ],
232    test_suites: [
233        "cts",
234        "mts-extservices",
235        "general-tests",
236        "mcts-extservices",
237    ],
238    plugins: [
239        "auto_value_plugin",
240        "auto_annotation_plugin",
241    ],
242    static_libs: [
243        "androidx.room_room-runtime",
244        "androidx.room_room-testing",
245        "androidx.test.rules",
246        "androidx.test.ext.junit",
247        "androidx.test.ext.truth",
248        "compatibility-device-util-axt",
249        "ctstestrunner-axt",
250        "cts-wm-util",
251        "adservices-clients",
252        "adservices-test-fixtures",
253        "adservices-test-utility",
254        "testng",
255        "auto_value_annotations",
256    ],
257    sdk_version: "module_current",
258    min_sdk_version: "30",
259    max_sdk_version: "32",
260    test_config: "AndroidTestDebuggable.ExtServices.xml",
261    manifest: "AndroidManifestDebuggableExtServices.xml",
262    lint: {
263        extra_check_modules: ["AdServicesTestLintChecker"],
264        baseline_filename: "lint-baseline-adextservices-debuggabletestcases.xml",
265        test: false, // TODO(b/343741206): remove when checks will run on android_test
266    },
267}
268
269java_library {
270    name: "adservices-cts-test-utility",
271    srcs: [
272        "src/android/adservices/utils/**/*.java",
273    ],
274    plugins: [
275        "auto_value_plugin",
276        "auto_annotation_plugin",
277    ],
278    libs: [
279        "framework-adservices-lib",
280    ],
281    static_libs: [
282        "adservices-clients",
283        "adservices-test-fixtures",
284        "adservices-test-utility",
285        "androidx.test.rules",
286        "androidx.test.ext.junit",
287        "auto_value_annotations",
288        "mockwebserver",
289        "testng",
290    ],
291    min_sdk_version: "Tiramisu",
292    lint: {
293        extra_check_modules: ["AdServicesTestLintChecker"],
294        baseline_filename: "lint-baseline-testutility.xml",
295        test: false, // TODO(b/343741206): remove when checks will run on android_test
296    },
297}
298
299// Assets need to be bundled via this android_library since tests in submodules need to load assets.
300android_library {
301    name: "adservices-cts-assets",
302    asset_dirs: [
303        "assets",
304    ],
305    // Must use EmptyManifest.xml since "adservices-assets" will also be used by submodule tests.
306    // If we use the normal "AndroidManifest.xml", we will redeclare permissions in the tests.
307    // See b/228270294 for detail on duplicate permissions error.
308    manifest: "EmptyManifest.xml",
309    min_sdk_version: "30",
310}
311