1// Copyright (C) 2016 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//
16
17package {
18    default_team: "trendy_team_aaos_framework",
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22android_test {
23    name: "CarServiceUnitTest",
24
25    srcs: [
26        "src/**/*.java",
27        "src/**/*.aidl",
28        ":car-service-dump-proto-srcs",
29    ],
30    proto: {
31        type: "lite",
32    },
33
34    aidl: {
35        include_dirs: [
36            "packages/services/Car/car-lib/src",
37        ],
38    },
39
40    aaptflags: [
41        "--extra-packages com.android.car",
42        "--auto-add-overlay",
43    ],
44
45    platform_apis: true,
46
47    certificate: "platform",
48
49    optimize: {
50        enabled: false,
51    },
52
53    instrumentation_for: "CarService",
54
55    sdk_version: "core_platform",
56
57    libs: [
58        "android.car",
59        "android.car.builtin.impl",
60        "android.car.watchdoglib",
61        "android.test.runner",
62        "android.test.base",
63        "android.test.mock",
64        // The following three lines are needed for tests that build against framework-bluetooth's
65        // @hide APIs. Order matters for the first two: classes in framework-bluetooth are
66        // resolved before framework, meaning @hide APIs in framework-bluetooth are resolved
67        // before @SystemApi stubs in framework. If sdk_version="", then the third line would get
68        // automatically included; since it isn't, it needs to be manually added here.
69        // (Ref: "framework-bluetooth-tests-defaults" in packages/modules/Bluetooth/framework/Android.bp)
70        "framework-bluetooth.impl",
71        "framework",
72        "framework-res",
73    ],
74
75    defaults: [
76        "car-framework-aconfig-libraries",
77    ],
78
79    static_libs: [
80        "android.car.testapi",
81        "android.car.test.utils",
82        "androidx.test.core",
83        "androidx.test.ext.junit",
84        "androidx.test.rules",
85        "car-service-test-static-lib",
86        "car-service-builtin-test-static-lib",
87        "car-helper-lib",
88        "com.android.car.test.lib",
89        "compatibility-device-util-axt",
90        "frameworks-base-testutils",
91        "flag-junit",
92        "ravenwood-junit",
93        "mockito-target-extended",
94        "ravenwood-junit",
95        "SettingsLib",
96        "servicestests-utils",
97        "truth",
98        "WindowManager-Shell", // for CarActivityServiceTaskMonitorUnitTest
99        "vehicle-hal-support-lib",
100    ],
101
102    test_suites: [
103        "device-tests",
104        "automotive-tests",
105    ],
106
107    // mockito-target-inline dependency
108    jni_libs: [
109        "libcarservicejni",
110        "libcarservicejni_test",
111        "libdexmakerjvmtiagent",
112        "libstaticjvmtiagent",
113    ],
114    // TODO(b/319708040): re-enable use_resource_processor
115    use_resource_processor: false,
116}
117
118android_ravenwood_test {
119    name: "CarServiceHostUnitTest",
120
121    srcs: [
122        "src/android/car/test/JUnitHelper.java",
123        "src/android/car/test/PermissionsCheckerRuleTest.java",
124        "src/com/android/car/CarPropertyServiceUnitTest.java",
125        "src/com/android/car/hal/VehicleHalTest.java",
126        "src/com/android/car/hal/fakevhal/FakeVhalConfigParserUnitTest.java",
127        "src/com/android/car/hal/fakevhal/FakeVehicleStubUnitTest.java",
128        "src/com/android/car/hal/property/PropertyHalServiceConfigsUnitTest.java",
129        // Don't depends on "com.android.car.test" because it uses
130        // "mockito-target-extended" which might not be the same mockito
131        // library used on host.
132        ":com.android.car.test.lib-srcs",
133    ],
134
135    static_libs: [
136        "android.car",
137        "android.car.testapi",
138        "android.car.test.utils",
139        "androidx.annotation_annotation",
140        "androidx.test.rules",
141        "car-service-test-static-lib",
142    ],
143
144    libs: [
145        "android.test.base",
146        "framework-annotations-lib",
147    ],
148
149    platform_apis: true,
150
151    auto_gen_config: true,
152}
153