xref: /aosp_15_r20/frameworks/av/services/camera/libcameraservice/tests/Android.bp (revision ec779b8e0859a360c3d303172224686826e6e0e1)
1// Copyright 2021 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: [
17        "frameworks_av_services_camera_libcameraservice_license",
18    ],
19}
20
21cc_defaults {
22    name: "cameraservice_test_hostsupported",
23
24    // All test sources that can run on both host and device
25    // should be listed here
26    srcs: [
27        "ClientManagerTest.cpp",
28        "DepthProcessorTest.cpp",
29        "DistortionMapperTest.cpp",
30        "ExifUtilsTest.cpp",
31        "NV12Compressor.cpp",
32        "RotateAndCropMapperTest.cpp",
33        "SessionStatsBuilderTest.cpp",
34        "ZoomRatioTest.cpp",
35    ],
36
37    // All shared libs available on both host and device
38    // should be listed here
39    shared_libs: [
40        "libbase",
41        "libbinder",
42        "libcamera_metadata",
43        "libexif",
44        "libjpeg",
45        "liblog",
46        "libutils",
47    ],
48
49    static_libs: [
50        "libgmock",
51    ],
52
53    target: {
54        android: {
55            shared_libs: [
56                "camera_platform_flags_c_lib",
57            ],
58        },
59        host: {
60            shared_libs: [
61                "camera_platform_flags_c_lib_for_test",
62            ],
63        },
64    },
65
66    cflags: [
67        "-Wall",
68        "-Wextra",
69        "-Werror",
70    ],
71
72    test_suites: ["device-tests"],
73
74}
75
76cc_test {
77    name: "cameraservice_test",
78
79    include_dirs: [
80        "system/media/private/camera/include",
81        "external/dynamic_depth/includes",
82        "external/dynamic_depth/internal",
83    ],
84
85    header_libs: [
86        "libmedia_headers",
87    ],
88
89    defaults: [
90        "libcameraservice_deps",
91        "cameraservice_test_hostsupported",
92    ],
93
94    // Only include libs that can't be run host-side here
95    shared_libs: [
96        "libcutils",
97        "libhidlbase",
98        "libcamera_client",
99        "libgui",
100        "libui",
101        "android.companion.virtualdevice.flags-aconfig-cc",
102        "[email protected]",
103        "[email protected]",
104        "[email protected]",
105        "[email protected]",
106        "[email protected]",
107        "[email protected]",
108        "camera_platform_flags_c_lib",
109    ],
110
111    // Only include libs that can't be run host-side here
112    static_libs: [
113        "[email protected]",
114        "[email protected]",
115        "[email protected]",
116        "[email protected]",
117        "android.hardware.camera.provider-V3-ndk",
118        "libcameraservice",
119        "libflagtest",
120    ],
121
122    // Only include sources that can't be run host-side here
123    srcs: [
124        "Camera3StreamSplitterTest.cpp",
125        "CameraPermissionsTest.cpp",
126        "CameraProviderManagerTest.cpp",
127    ],
128
129}
130
131cc_test_host {
132    name: "cameraservice_test_host",
133
134    defaults: [
135        "cameraservice_test_hostsupported",
136    ],
137
138    include_dirs: [
139        "frameworks/av/camera/include",
140        "frameworks/av/camera/include/camera",
141        "frameworks/native/libs/binder/include_activitymanager",
142    ],
143
144    // Only include libs that can't be run device-side here
145    shared_libs: [
146        "libactivity_manager_procstate_aidl-cpp",
147        "libdynamic_depth",
148    ],
149
150    // Only include libs that can't be run device-side here
151    static_libs: [
152        "libcamera_client_host",
153        "libcameraservice_device_independent",
154    ],
155
156}
157