1# Copyright (c) 2022-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_channel_test"
19
20config("module_private_config") {
21  visibility = [ ":*" ]
22  include_dirs = [
23    "include",
24    "${common_path}/include/constants",
25    "${common_path}/include/utils",
26    "${services_path}/cameraservice/base/include",
27    "${services_path}/channel/include",
28    "${services_path}/channel/test/unittest/common/channel",
29    "${services_path}/cameraservice/cameraoperator/client/include",
30    "${services_path}/cameraservice/cameraoperator/client/include/callback",
31    "${services_path}/cameraservice/cameraoperator/client/include/listener",
32    "${services_path}/cameraservice/cameraoperator/handler/include",
33    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr",
34    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr/callback",
35    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr/eventbus",
36    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr/interface",
37    "${services_path}/cameraservice/sinkservice/include/distributedcameramgr/listener",
38    "${services_path}/cameraservice/sinkservice/test/unittest/common/distributedcameramgr",
39    "${services_path}/cameraservice/sourceservice/include/distributedcameramgr",
40    "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcameradata",
41    "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcamerainterface",
42    "${services_path}/cameraservice/sourceservice/include/distributedcameramgr/dcamerastate",
43    "${services_path}/cameraservice/sourceservice/test/unittest/common/distributedcameramgr",
44    "${services_path}/data_process/include/utils",
45    "${innerkits_path}/native_cpp/camera_source/include",
46    "${innerkits_path}/native_cpp/camera_source/include/callback",
47    "${feeding_smoother_path}/base",
48  ]
49}
50
51ohos_unittest("DCameraChannelTest") {
52  module_out_path = module_out_path
53
54  sources = [
55    "${services_path}/cameraservice/base/src/dcamera_sink_frame_info.cpp",
56    "${services_path}/channel/src/dcamera_channel_sink_impl.cpp",
57    "${services_path}/channel/src/dcamera_channel_source_impl.cpp",
58    "${services_path}/channel/src/dcamera_softbus_adapter.cpp",
59    "${services_path}/channel/src/dcamera_softbus_latency.cpp",
60    "${services_path}/channel/src/dcamera_softbus_session.cpp",
61    "dcamera_channel_sink_impl_test.cpp",
62    "dcamera_channel_source_impl_test.cpp",
63    "dcamera_softbus_adapter_test.cpp",
64    "dcamera_softbus_latency_test.cpp",
65    "dcamera_softbus_session_test.cpp",
66    "session_bus_center.cpp",
67    "session_mock.cpp",
68  ]
69
70  configs = [ ":module_private_config" ]
71
72  deps = [
73    "${common_path}:distributed_camera_utils",
74    "${services_path}/cameraservice/sinkservice:distributed_camera_sink",
75    "${services_path}/cameraservice/sourceservice:distributed_camera_source",
76    "${services_path}/data_process:distributed_camera_data_process",
77  ]
78
79  external_deps = [
80    "cJSON:cjson",
81    "c_utils:utils",
82    "distributed_hardware_fwk:distributedhardwareutils",
83    "drivers_interface_distributed_camera:libdistributed_camera_provider_proxy_1.1",
84    "eventhandler:libeventhandler",
85    "graphic_surface:surface",
86    "hdf_core:libhdi",
87    "hilog:libhilog",
88  ]
89
90  defines = [
91    "HI_LOG_ENABLE",
92    "DH_LOG_TAG=\"DCameraChannelTest\"",
93    "LOG_DOMAIN=0xD004150",
94  ]
95}
96
97group("dcamera_channel_test") {
98  testonly = true
99  deps = [ ":DCameraChannelTest" ]
100}
101