1# Copyright (c) 2021 - 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15import(
16    "//foundation/distributedhardware/distributed_camera/distributedcamera.gni")
17
18module_out_path = "distributed_camera/dcamera_sink_mgr_test"
19
20config("module_private_config") {
21  visibility = [ ":*" ]
22  include_dirs = [
23    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr",
24    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr/callback",
25    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr/interface",
26    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr/listener",
27    "${services_path}/cameraservice/cameraoperator/client/include",
28    "${services_path}/cameraservice/cameraoperator/handler/include",
29    "${services_path}/cameraservice/base/include",
30    "${services_path}/channel/include",
31    "${services_path}/data_process/include/pipeline",
32    "${services_path}/data_process/include/interfaces",
33    "${services_path}/data_process/include/utils",
34    "${common_path}/include/constants",
35    "${common_path}/include/utils",
36    "${innerkits_path}/native_cpp/camera_source/include",
37    "${innerkits_path}/native_cpp/camera_source/include/callback",
38    "${innerkits_path}/native_cpp/camera_sink/include/callback",
39
40    "${feeding_smoother_path}/base",
41    "${feeding_smoother_path}/derived",
42    "${feeding_smoother_path}/utils",
43  ]
44}
45
46ohos_unittest("DCameraSinkMgrTest") {
47  sanitize = {
48    cfi = true
49    cfi_cross_dso = true
50    debug = false
51  }
52  module_out_path = module_out_path
53
54  sources = [
55    "dcamera_sink_access_control_test.cpp",
56    "dcamera_sink_controller_test.cpp",
57    "dcamera_sink_data_process_test.cpp",
58    "dcamera_sink_dev_test.cpp",
59    "dcamera_sink_output_test.cpp",
60    "dcamera_sink_service_ipc_test.cpp",
61  ]
62
63  cflags = [
64    "-Dprivate=public",
65    "-Dprotected=public",
66  ]
67
68  configs = [ ":module_private_config" ]
69
70  deps = [
71    "${common_path}:distributed_camera_utils",
72    "${innerkits_path}/native_cpp/camera_sink:distributed_camera_sink_sdk",
73    "${services_path}/cameraservice/cameraoperator/handler:distributed_camera_handler",
74    "${services_path}/cameraservice/sinkservice:distributed_camera_sink",
75    "${services_path}/channel:distributed_camera_channel",
76    "${services_path}/data_process:distributed_camera_data_process",
77  ]
78
79  external_deps = [
80    "access_token:libaccesstoken_sdk",
81    "access_token:libnativetoken_shared",
82    "access_token:libtokensetproc_shared",
83    "av_codec:av_codec_client",
84    "cJSON:cjson",
85    "c_utils:utils",
86    "camera_framework:camera_framework",
87    "device_manager:devicemanagersdk",
88    "distributed_hardware_fwk:distributedhardwareutils",
89    "drivers_interface_camera:metadata",
90    "drivers_interface_distributed_camera:libdistributed_camera_provider_proxy_1.1",
91    "drivers_peripheral_display:hdi_gralloc_client",
92    "dsoftbus:softbus_client",
93    "eventhandler:libeventhandler",
94    "graphic_surface:surface",
95    "hilog:libhilog",
96    "ipc:ipc_core",
97  ]
98
99  defines = [
100    "HI_LOG_ENABLE",
101    "DH_LOG_TAG=\"DCameraSinkMgrTest\"",
102    "LOG_DOMAIN=0xD004150",
103  ]
104}
105
106group("dcamera_sink_mgr_test") {
107  testonly = true
108  deps = [ ":DCameraSinkMgrTest" ]
109}
110