1# Copyright (c) 2021-2022 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/ohos.gni") 15import("//build/test.gni") 16import("../../multimodalinput_mini.gni") 17module_output_path = "multimodalinput/mmi_unit_out" 18 19config("event_injection_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "include", 24 "${mmi_path}/util/common/include", 25 "${mmi_path}/interfaces/native/innerkits/common/include", 26 ] 27} 28 29config("event_injection_public_config") { 30 include_dirs = [ 31 "include", 32 "${mmi_path}/util/common/include", 33 "${mmi_path}/interfaces/native/innerkits/common/include", 34 "//third_party/cJSON", 35 "//third_party/FreeBSD/sys/dev/evdev", 36 ] 37} 38 39ohos_source_set("event-injection") { 40 sources = event_injection_sources 41 stack_protector_ret = true 42 sanitize = { 43 cfi = true 44 cfi_cross_dso = true 45 debug = false 46 } 47 configs = [ 48 ":event_injection_config", 49 ":event_injection_public_config", 50 ] 51 52 deps = [ 53 "${mmi_path}/patch/diff_libinput_mmi:libinput-third-mmi", 54 "${mmi_path}/service/connect_manager:mmi_connect_manager_proxy", 55 "${mmi_path}/service/filter:mmi_event_filter_service", 56 "${mmi_path}/util:libmmi-util", 57 "//third_party/cJSON:cjson", 58 ] 59 60 external_deps = [ 61 "c_utils:utils", 62 "ipc:ipc_single", 63 ] 64 65 part_name = "input" 66 subsystem_name = "multimodalinput" 67} 68 69ohos_unittest("ut-event-injection-out") { 70 module_out_path = module_output_path 71 72 configs = [ "${mmi_path}:coverage_flags" ] 73 74 include_dirs = [ 75 "${mmi_path}/frameworks/proxy/event_handler", 76 "${mmi_path}/frameworks/proxy/event_handler/include", 77 "${mmi_path}/frameworks/proxy/module_loader", 78 "${mmi_path}/frameworks/proxy/module_loader/include", 79 "${mmi_path}/util/common", 80 "${mmi_path}/util/common/include", 81 "${mmi_path}/util/network", 82 "${mmi_path}/util/network/include", 83 "${mmi_path}/util/socket", 84 "${mmi_path}/util/socket/include", 85 "${mmi_path}/frameworks/proxy/event_handle", 86 "${mmi_path}/frameworks/proxy/event_handle/include", 87 "${mmi_path}/frameworks/proxy/module_loader", 88 "${mmi_path}/frameworks/proxy/module_loader/include", 89 "${mmi_path}/interfaces/native/innerkits/common/include", 90 "${mmi_path}/interfaces/native/innerkits/proxy/include", 91 "${mmi_path}/interfaces/native/innerkits/event/include", 92 "${mmi_path}/service/include", 93 "${mmi_path}/service/device_scalability/include", 94 "${mmi_path}/service/event_dispatch/include", 95 "${mmi_path}/service/event_handler/include", 96 "${mmi_path}/service/event_standard/include", 97 "${mmi_path}/service/libinput_adapter/include", 98 "${mmi_path}/service/message_handle/include", 99 "${mmi_path}/service/module_loader/include", 100 "${mmi_path}/service/window_manager/include", 101 "${mmi_path}/tools/event_inject/include", 102 "${mmi_path}/uinput", 103 "$root_out_dir/diff_libinput_mmi/export_include", 104 "//third_party/cJSON", 105 "//third_party/googletest/googletest/include", 106 ] 107 108 sources = [ 109 "test/device_base_test.cpp", 110 "test/get_device_node_test.cpp", 111 "test/get_device_object_test.cpp", 112 "test/injection_tools_help_func_test.cpp", 113 "test/processing_finger_device_test.cpp", 114 "test/processing_game_pad_device_test.cpp", 115 "test/processing_joystick_device_test.cpp", 116 "test/processing_keyboard_device_test.cpp", 117 "test/processing_mouse_device_test.cpp", 118 "test/processing_pad_device_test.cpp", 119 "test/processing_pen_device_test.cpp", 120 "test/processing_touch_screen_device_test.cpp", 121 ] 122 123 deps = [ 124 "${mmi_path}/frameworks/proxy:libmmi-client", 125 "${mmi_path}/patch/diff_libinput_mmi:libinput-third-mmi", 126 "${mmi_path}/service:libmmi-server", 127 "${mmi_path}/tools/event_inject:event-injection", 128 "${mmi_path}/util:libmmi-util", 129 "//third_party/cJSON:cjson", 130 "//third_party/googletest:gmock_main", 131 "//third_party/googletest:gtest_main", 132 ] 133 134 external_deps = [ 135 "c_utils:utils", 136 "hilog:libhilog", 137 "image_framework:image_native", 138 "ipc:ipc_single", 139 ] 140} 141 142ohos_executable("mmi-event-injection") { 143 sources = [ "src/mmi_event_simulate_main.cpp" ] 144 stack_protector_ret = true 145 sanitize = { 146 cfi = true 147 cfi_cross_dso = true 148 debug = false 149 } 150 configs = [ ":event_injection_public_config" ] 151 152 deps = [ 153 "${mmi_path}/patch/diff_libinput_mmi:libinput-third-mmi", 154 "${mmi_path}/tools/event_inject:event-injection", 155 "${mmi_path}/util:libmmi-util", 156 ] 157 external_deps = [ "c_utils:utils" ] 158 install_enable = true 159 part_name = "input" 160 subsystem_name = "multimodalinput" 161} 162