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.
14package {
15    default_applicable_licenses: ["Android-Apache-2.0"],
16}
17
18java_defaults {
19    name: "health-connect-controller-tests-default",
20    srcs: [
21        "src/com/android/healthconnect/controller/tests/utils/**/*.java",
22        "src/com/android/healthconnect/controller/tests/utils/**/*.kt",
23        "src/**/HiltTestRunner.kt",
24        "src/**/TestActivity.kt",
25    ],
26    defaults: ["modules-utils-testable-device-config-defaults"],
27    sdk_version: "module_current",
28    min_sdk_version: "34",
29    static_libs: [
30        "androidx.test.core",
31        "androidx.test.rules",
32        "HealthConnectPermissionsApis",
33        "HealthConnectLibrary",
34        "SettingsLibSettingsTheme",
35        "kotlin-stdlib",
36        "kotlinx-coroutines-android",
37        "androidx.navigation_navigation-common-ktx",
38        "androidx.navigation_navigation-fragment-ktx",
39        "androidx.navigation_navigation-runtime-ktx",
40        "androidx.navigation_navigation-ui-ktx",
41        "androidx.navigation_navigation-testing",
42        "SettingsLibCollapsingToolbarBaseActivity",
43        "SettingsLibHelpUtils",
44        "SettingsLibTopIntroPreference",
45        "SettingsLibFooterPreference",
46        "androidx.annotation_annotation",
47        "hilt_android_testing",
48        "kotlinx_coroutines_test",
49        // test dependencies
50        "androidx.test.espresso.contrib",
51        "androidx.test.espresso.intents",
52        "androidx.test.espresso.core",
53        "androidx.test.ext.junit",
54        "androidx.test.ext.truth",
55        "androidx.test.rules",
56        "compatibility-device-util-axt",
57        "mockito-kotlin2",
58    ],
59    libs: [
60        "kotlin-annotations",
61        "android.test.base",
62        "android.test.mock.stubs",
63        "framework-healthfitness.impl",
64    ],
65    kotlincflags: ["-Xjvm-default=all"],
66    test_suites: [
67        "general-tests",
68        "mts-healthfitness",
69    ],
70    test_mainline_modules: ["com.google.android.healthfitness.apex"],
71    data: [
72        ":HealthConnectUITestApp",
73        ":HealthConnectUITestApp2",
74        ":UnsupportedTestApp",
75        ":OldPermissionsTestApp",
76    ],
77    test_config_template: "AndroidTestTemplate.xml",
78    visibility: ["//visibility:private"],
79}
80
81java_library {
82    name: "SafetyCenterTests",
83    srcs: [
84        "src/**/safetycenter/*.kt",
85    ],
86    sdk_version: "module_current",
87    min_sdk_version: "34",
88    static_libs: [
89        "kotlin-stdlib",
90        "hilt_android",
91        "androidx.test.core",
92        "androidx.test.rules",
93        "androidx.test.espresso.contrib",
94        "androidx.test.ext.junit",
95        "androidx.test.ext.truth",
96        "androidx.test.rules",
97        "HealthConnectLibrary",
98        "hilt_android_testing",
99        "mockito-target-minus-junit4",
100    ],
101    libs: [
102        "android.test.mock.stubs",
103        "android.test.mock",
104        "framework-permission-s",
105    ],
106}
107
108filegroup {
109    name: "data-screens-new-tests-srcs",
110    srcs: [
111        "src/com/android/healthconnect/controller/tests/data/**/*.java",
112        "src/com/android/healthconnect/controller/tests/data/**/*.kt",
113        "src/com/android/healthconnect/controller/selectabledeletion/**/*.kt",
114        "src/com/android/healthconnect/controller/selectabledeletion/**/*.java",
115    ],
116    visibility: ["//visibility:private"],
117}
118
119android_test {
120    name: "HealthConnectControllerDataScreensNewTests",
121    srcs: [":data-screens-new-tests-srcs"],
122    defaults: ["health-connect-controller-tests-default"],
123    package_name: "com.android.healthconnect.controller.tests.data.screens.new",
124    instrumentation_target_package: "com.android.healthconnect.controller.tests.data.screens.new",
125}
126
127filegroup {
128    name: "data-screens-old-tests-srcs",
129    srcs: [
130        "src/com/android/healthconnect/controller/tests/categories/**/*.java",
131        "src/com/android/healthconnect/controller/tests/categories/**/*.kt",
132        "src/com/android/healthconnect/controller/tests/dataaccess/**/*.java",
133        "src/com/android/healthconnect/controller/tests/dataaccess/**/*.kt",
134        "src/com/android/healthconnect/controller/tests/dataentries/**/*.java",
135        "src/com/android/healthconnect/controller/tests/dataentries/**/*.kt",
136        "src/com/android/healthconnect/controller/tests/entrydetails/**/*.java",
137        "src/com/android/healthconnect/controller/tests/entrydetails/**/*.kt",
138        "src/com/android/healthconnect/controller/tests/permissiontypes/**/*.java",
139        "src/com/android/healthconnect/controller/tests/permissiontypes/**/*.kt",
140    ],
141    visibility: ["//visibility:private"],
142}
143
144android_test {
145    name: "HealthConnectControllerDataScreensOldTests",
146    srcs: [":data-screens-old-tests-srcs"],
147    defaults: ["health-connect-controller-tests-default"],
148    package_name: "com.android.healthconnect.controller.tests.data.screens.old",
149    instrumentation_target_package: "com.android.healthconnect.controller.tests.data.screens.old",
150}
151
152filegroup {
153    name: "deletion-tests-srcs",
154    srcs: [
155        "src/com/android/healthconnect/controller/tests/autodelete/**/*.java",
156        "src/com/android/healthconnect/controller/tests/autodelete/**/*.kt",
157        "src/com/android/healthconnect/controller/tests/deletion/**/*.kt",
158        "src/com/android/healthconnect/controller/tests/deletion/**/*.kt",
159        "src/com/android/healthconnect/controller/tests/selectabledeletion/**/*.kt",
160        "src/com/android/healthconnect/controller/tests/selectabledeletion/**/*.kt",
161    ],
162    visibility: ["//visibility:private"],
163}
164
165android_test {
166    name: "HealthConnectControllerDeletionTests",
167    srcs: [":deletion-tests-srcs"],
168    defaults: ["health-connect-controller-tests-default"],
169    package_name: "com.android.healthconnect.controller.tests.deletion",
170    instrumentation_target_package: "com.android.healthconnect.controller.tests.deletion",
171}
172
173filegroup {
174    name: "exercise-route-tests-srcs",
175    srcs: [
176        "src/com/android/healthconnect/controller/tests/route/**/*.java",
177        "src/com/android/healthconnect/controller/tests/route/**/*.kt",
178    ],
179    visibility: ["//visibility:private"],
180}
181
182android_test {
183    name: "HealthConnectControllerExerciseRouteTests",
184    srcs: [":exercise-route-tests-srcs"],
185    defaults: ["health-connect-controller-tests-default"],
186    package_name: "com.android.healthconnect.controller.tests.exercise.routes",
187    instrumentation_target_package: "com.android.healthconnect.controller.tests.exercise.routes",
188}
189
190filegroup {
191    name: "export-tests-srcs",
192    srcs: [
193        "src/com/android/healthconnect/controller/tests/exportimport/**/*.java",
194        "src/com/android/healthconnect/controller/tests/exportimport/**/*.kt",
195    ],
196    visibility: ["//visibility:private"],
197}
198
199android_test {
200    name: "HealthConnectControllerExportTests",
201    srcs: [":export-tests-srcs"],
202    static_libs: [
203        "HealthConnectExportApis",
204    ],
205    defaults: ["health-connect-controller-tests-default"],
206    package_name: "com.android.healthconnect.controller.tests.exportimport",
207    instrumentation_target_package: "com.android.healthconnect.controller.tests.exportimport",
208}
209
210filegroup {
211    name: "home-and-onboarding-tests-srcs",
212    srcs: [
213        "src/com/android/healthconnect/controller/tests/home/**/*.java",
214        "src/com/android/healthconnect/controller/tests/home/**/*.kt",
215        "src/com/android/healthconnect/controller/tests/onboarding/**/*.java",
216        "src/com/android/healthconnect/controller/tests/onboarding/**/*.kt",
217        "src/com/android/healthconnect/controller/tests/recentaccess/**/*.java",
218        "src/com/android/healthconnect/controller/tests/recentaccess/**/*.kt",
219    ],
220    visibility: ["//visibility:private"],
221}
222
223android_test {
224    name: "HealthConnectControllerHomePageAndOnboardingTests",
225    srcs: [":home-and-onboarding-tests-srcs"],
226    defaults: ["health-connect-controller-tests-default"],
227    package_name: "com.android.healthconnect.controller.tests.home.and.onboarding",
228    instrumentation_target_package: "com.android.healthconnect.controller.tests.home.and.onboarding",
229}
230
231filegroup {
232    name: "manage-data-tests-srcs",
233    srcs: [
234        "src/com/android/healthconnect/controller/tests/datasources/**/*.java",
235        "src/com/android/healthconnect/controller/tests/datasources/**/*.kt",
236        "src/com/android/healthconnect/controller/tests/managedata/**/*.java",
237        "src/com/android/healthconnect/controller/tests/managedata/**/*.kt",
238    ],
239    visibility: ["//visibility:private"],
240}
241
242android_test {
243    name: "HealthConnectControllerManageDataTests",
244    srcs: [":manage-data-tests-srcs"],
245    defaults: ["health-connect-controller-tests-default"],
246    package_name: "com.android.healthconnect.controller.tests.manage.data",
247    instrumentation_target_package: "com.android.healthconnect.controller.tests.manage.data",
248}
249
250filegroup {
251    name: "migration-tests-srcs",
252    srcs: [
253        "src/com/android/healthconnect/controller/tests/migration/**/*.java",
254        "src/com/android/healthconnect/controller/tests/migration/**/*.kt",
255    ],
256    visibility: ["//visibility:private"],
257}
258
259android_test {
260    name: "HealthConnectControllerMigrationTests",
261    srcs: [":migration-tests-srcs"],
262    static_libs: [
263        "HealthConnectMigrationApis",
264    ],
265    defaults: ["health-connect-controller-tests-default"],
266    package_name: "com.android.healthconnect.controller.tests.migration",
267    instrumentation_target_package: "com.android.healthconnect.controller.tests.migration",
268}
269
270filegroup {
271    name: "navigation-tests-srcs",
272    srcs: [
273        "src/com/android/healthconnect/controller/tests/navigation/**/*.java",
274        "src/com/android/healthconnect/controller/tests/navigation/**/*.kt",
275    ],
276    visibility: ["//visibility:private"],
277}
278
279android_test {
280    name: "HealthConnectControllerNavigationTests",
281    srcs: [":navigation-tests-srcs"],
282    defaults: ["health-connect-controller-tests-default"],
283    package_name: "com.android.healthconnect.controller.tests.navigation",
284    instrumentation_target_package: "com.android.healthconnect.controller.tests.navigation",
285}
286
287filegroup {
288    name: "permission-tests-srcs",
289    srcs: [
290        "src/com/android/healthconnect/controller/tests/permissions/**/*.java",
291        "src/com/android/healthconnect/controller/tests/permissions/**/*.kt",
292        "src/com/android/healthconnect/controller/tests/shared/**/*.java",
293        "src/com/android/healthconnect/controller/tests/shared/**/*.kt",
294    ],
295    visibility: ["//visibility:private"],
296}
297
298android_test {
299    name: "HealthConnectControllerPermissionTests",
300    srcs: [":permission-tests-srcs"],
301    defaults: ["health-connect-controller-tests-default"],
302    package_name: "com.android.healthconnect.controller.tests.permissions",
303    instrumentation_target_package: "com.android.healthconnect.controller.tests.permissions",
304}
305
306filegroup {
307    name: "extra-tests-srcs",
308    srcs: [
309        "src/**/*.java",
310        "src/**/*.kt",
311    ],
312    exclude_srcs: [
313        ":deletion-tests-srcs",
314        ":data-screens-new-tests-srcs",
315        ":data-screens-old-tests-srcs",
316        ":exercise-route-tests-srcs",
317        ":home-and-onboarding-tests-srcs",
318        ":manage-data-tests-srcs",
319        ":migration-tests-srcs",
320        ":navigation-tests-srcs",
321        ":permission-tests-srcs",
322        "src/**/safetycenter/*.kt",
323    ],
324    visibility: ["//visibility:private"],
325}
326
327android_test {
328    name: "HealthConnectControllerExtraTests",
329    srcs: [":extra-tests-srcs"],
330    defaults: ["health-connect-controller-tests-default"],
331    package_name: "com.android.healthconnect.controller.tests.extras",
332    instrumentation_target_package: "com.android.healthconnect.controller.tests.extras",
333}
334
335android_test {
336    name: "HealthConnectControllerUITests",
337    srcs: [
338        "src/**/*.java",
339        "src/**/*.kt",
340    ],
341    exclude_srcs: [
342        "src/**/safetycenter/*.kt",
343    ],
344    defaults: ["health-connect-controller-tests-default"],
345    static_libs: [
346        "SafetyCenterTests",
347        "HealthConnectMigrationApis",
348        "HealthConnectExportApis",
349    ],
350    package_name: "com.android.healthconnect.controller.tests",
351    instrumentation_target_package: "com.android.healthconnect.controller.tests",
352}
353