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_input/distributedinput.gni") 17 18module_out_path = "distributed_input/sink_handler" 19 20group("unittest") { 21 testonly = true 22 23 deps = [ ":distributed_input_sink_handler_test" ] 24} 25 26## UnitTest distributed_input_manager_service_test {{{ 27ohos_unittest("distributed_input_sink_handler_test") { 28 module_out_path = module_out_path 29 30 include_dirs = [ 31 "${distributedinput_path}/sinkhandler/include", 32 "${innerkits_path}/include", 33 "${innerkits_path}/src", 34 "${ipc_path}/include", 35 "${ipc_path}/src", 36 "${services_sink_path}/sinkmanager/include", 37 "${frameworks_path}/include", 38 "${service_common}/include", 39 "${common_path}/include", 40 "${dfx_utils_path}/include", 41 "${services_source_path}/inputinject/include", 42 "${utils_path}/include", 43 ] 44 45 sources = [ 46 "${distributedinput_path}/sinkhandler/src/distributed_input_sink_handler.cpp", 47 "${distributedinput_path}/sinkhandler/src/load_d_input_sink_callback.cpp", 48 "${distributedinput_path}/sinkhandler/test/unittest/mock/mock_distributed_input_client.cpp", 49 "distributed_input_sinkhandler_test.cpp", 50 ] 51 52 cflags = [ 53 "-Wall", 54 "-Werror", 55 "-g3", 56 "-Dprivate=public", 57 "-Dprotected=public", 58 ] 59 60 defines = [ 61 "HI_LOG_ENABLE", 62 "DH_LOG_TAG=\"distributedinpututtest\"", 63 "LOG_DOMAIN=0xD004120", 64 ] 65 66 deps = [ 67 "${dfx_utils_path}:libdinput_dfx_utils", 68 "${innerkits_path}:libdinput_sdk", 69 "${utils_path}:libdinput_utils", 70 ] 71 72 external_deps = [ 73 "c_utils:utils", 74 "distributed_hardware_fwk:distributedhardwareutils", 75 "distributed_hardware_fwk:libdhfwk_sdk", 76 "eventhandler:libeventhandler", 77 "hilog:libhilog", 78 "hisysevent:libhisysevent", 79 "ipc:ipc_core", 80 "json:nlohmann_json_static", 81 "samgr:samgr_proxy", 82 ] 83 84 cflags_cc = [ "-DHILOG_ENABLE" ] 85} 86## UnitTest distributed_input_manager_service_test }}} 87