• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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_input/distributedinput.gni")
17
18module_out_path = unittest_output_path
19
20group("sinkmanagerunittest") {
21  testonly = true
22
23  deps = [ ":distributed_input_sinkmanager_test" ]
24}
25
26## UnitTest distributed_input_manager_service_test {{{
27ohos_unittest("distributed_input_sinkmanager_test") {
28  module_out_path = module_out_path
29
30  sanitize = {
31    cfi = true
32    cfi_cross_dso = true
33    debug = false
34  }
35
36  include_dirs = [
37    "${innerkits_path}/include",
38    "${innerkits_path}/src",
39    "${ipc_path}/include",
40    "${ipc_path}/src",
41    "${distributedinput_path}/services/transportbase/include",
42    "${services_sink_path}/transport/include",
43    "${services_sink_path}/sinkmanager/include",
44    "${frameworks_path}/include",
45    "${common_path}/include",
46    "${services_state_path}/include",
47    "${service_common}/include",
48    "${services_sink_path}/inputcollector/include",
49    "${dfx_utils_path}/include",
50    "${utils_path}/include",
51    "${common_path}/test/mock",
52    "${services_sink_path}/sinkmanager/test/sinkmanagerunittest/mock/",
53    "${distributedinput_path}/services/state/include",
54  ]
55
56  sources = [
57    "${common_path}/include/input_hub.cpp",
58    "${common_path}/include/white_list_util.cpp",
59    "${common_path}/test/mock/socket_mock.cpp",
60    "${common_path}/test/mock/softbus_bus_center_mock.cpp",
61    "${ipc_path}/src/distributed_input_sink_stub.cpp",
62    "${ipc_path}/src/get_sink_screen_infos_call_back_stub.cpp",
63    "${ipc_path}/src/sharing_dhid_listener_stub.cpp",
64    "${services_sink_path}/inputcollector/src/distributed_input_collector.cpp",
65    "${services_sink_path}/sinkmanager/src/distributed_input_sink_event_handler.cpp",
66    "${services_sink_path}/sinkmanager/src/distributed_input_sink_manager.cpp",
67    "${services_sink_path}/sinkmanager/test/sinkmanagerunittest/mock/mock_process.cpp",
68    "${services_sink_path}/transport/src/distributed_input_sink_switch.cpp",
69    "${services_sink_path}/transport/src/distributed_input_sink_transport.cpp",
70    "distributed_input_sinkmanager_test.cpp",
71  ]
72
73  cflags = [
74    "-Wall",
75    "-Werror",
76    "-g3",
77    "-Dprivate=public",
78    "-Dprotected=public",
79  ]
80
81  defines = [
82    "HI_LOG_ENABLE",
83    "DH_LOG_TAG=\"distributedinpututtest\"",
84    "LOG_DOMAIN=0xD004120",
85  ]
86
87  deps = [
88    "${dfx_utils_path}:libdinput_dfx_utils",
89    "${distributedinput_path}/services/state:libdinput_sink_state",
90    "${distributedinput_path}/services/transportbase:libdinput_trans_base",
91    "${services_sink_path}/transport:libdinput_sink_trans",
92    "${utils_path}:libdinput_utils",
93  ]
94
95  external_deps = [
96    "access_token:libaccesstoken_sdk",
97    "access_token:libnativetoken",
98    "access_token:libtoken_setproc",
99    "cJSON:cjson_static",
100    "c_utils:utils",
101    "config_policy:configpolicy_util",
102    "distributed_hardware_fwk:distributed_av_receiver",
103    "distributed_hardware_fwk:distributed_av_sender",
104    "distributed_hardware_fwk:distributedhardwareutils",
105    "distributed_hardware_fwk:libdhfwk_sdk",
106    "dsoftbus:softbus_client",
107    "eventhandler:libeventhandler",
108    "graphic_2d:librender_service_base",
109    "graphic_surface:surface",
110    "hicollie:libhicollie",
111    "hilog:libhilog",
112    "hisysevent:libhisysevent",
113    "ipc:ipc_core",
114    "json:nlohmann_json_static",
115    "libevdev:libevdev",
116    "openssl:libcrypto_shared",
117    "safwk:system_ability_fwk",
118    "samgr:samgr_proxy",
119    "selinux_adapter:librestorecon",
120    "window_manager:libdm",
121  ]
122
123  cflags_cc = [ "-DHILOG_ENABLE" ]
124}
125## UnitTest distributed_input_manager_service_test }}}
126