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/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 42 configs = [ 43 ":event_injection_config", 44 ":event_injection_public_config", 45 ] 46 47 deps = [ 48 "${mmi_path}/patch/diff_libinput_mmi:libinput-third-mmi", 49 "${mmi_path}/service/connect_manager:mmi_connect_manager_proxy", 50 "${mmi_path}/service/filter:mmi_event_filter_service", 51 "${mmi_path}/util:libmmi-util", 52 "//third_party/cJSON:cjson", 53 ] 54 55 external_deps = [ 56 "c_utils:utils", 57 "ipc:ipc_single", 58 ] 59 60 part_name = "input" 61 subsystem_name = "multimodalinput" 62} 63 64ohos_unittest("ut-event-injection-out") { 65 module_out_path = module_output_path 66 67 configs = [ "${mmi_path}:coverage_flags" ] 68 69 include_dirs = [ 70 "${mmi_path}/frameworks/proxy/event_handler", 71 "${mmi_path}/frameworks/proxy/event_handler/include", 72 "${mmi_path}/frameworks/proxy/module_loader", 73 "${mmi_path}/frameworks/proxy/module_loader/include", 74 "${mmi_path}/util/common", 75 "${mmi_path}/util/common/include", 76 "${mmi_path}/util/network", 77 "${mmi_path}/util/network/include", 78 "${mmi_path}/util/socket", 79 "${mmi_path}/util/socket/include", 80 "${mmi_path}/frameworks/proxy/event_handle", 81 "${mmi_path}/frameworks/proxy/event_handle/include", 82 "${mmi_path}/frameworks/proxy/module_loader", 83 "${mmi_path}/frameworks/proxy/module_loader/include", 84 "${mmi_path}/interfaces/native/innerkits/common/include", 85 "${mmi_path}/interfaces/native/innerkits/proxy/include", 86 "${mmi_path}/interfaces/native/innerkits/event/include", 87 "${mmi_path}/service/include", 88 "${mmi_path}/service/device_scalability/include", 89 "${mmi_path}/service/event_dispatch/include", 90 "${mmi_path}/service/event_handler/include", 91 "${mmi_path}/service/event_standard/include", 92 "${mmi_path}/service/libinput_adapter/include", 93 "${mmi_path}/service/message_handle/include", 94 "${mmi_path}/service/module_loader/include", 95 "${mmi_path}/service/window_manager/include", 96 "${mmi_path}/tools/event_inject/include", 97 "${mmi_path}/uinput", 98 "$root_out_dir/diff_libinput_mmi/export_include", 99 "//third_party/cJSON", 100 "//third_party/googletest/googletest/include", 101 ] 102 103 sources = [ 104 "test/device_base_test.cpp", 105 "test/get_device_node_test.cpp", 106 "test/get_device_object_test.cpp", 107 "test/injection_tools_help_func_test.cpp", 108 "test/processing_finger_device_test.cpp", 109 "test/processing_game_pad_device_test.cpp", 110 "test/processing_joystick_device_test.cpp", 111 "test/processing_keyboard_device_test.cpp", 112 "test/processing_mouse_device_test.cpp", 113 "test/processing_pad_device_test.cpp", 114 "test/processing_pen_device_test.cpp", 115 "test/processing_touch_screen_device_test.cpp", 116 ] 117 118 deps = [ 119 "${mmi_path}/frameworks/proxy:libmmi-client", 120 "${mmi_path}/patch/diff_libinput_mmi:libinput-third-mmi", 121 "${mmi_path}/service:libmmi-server", 122 "${mmi_path}/tools/event_inject:event-injection", 123 "${mmi_path}/util:libmmi-util", 124 "//third_party/cJSON:cjson", 125 "//third_party/googletest:gmock_main", 126 "//third_party/googletest:gtest_main", 127 ] 128 129 external_deps = [ 130 "c_utils:utils", 131 "hilog:libhilog", 132 "image_framework:image_native", 133 "ipc:ipc_single", 134 ] 135} 136 137ohos_executable("mmi-event-injection") { 138 sources = [ "src/mmi_event_simulate_main.cpp" ] 139 140 configs = [ ":event_injection_public_config" ] 141 142 deps = [ 143 "${mmi_path}/patch/diff_libinput_mmi:libinput-third-mmi", 144 "${mmi_path}/tools/event_inject:event-injection", 145 "${mmi_path}/util:libmmi-util", 146 ] 147 external_deps = [ "c_utils:utils" ] 148 install_enable = true 149 part_name = "input" 150 subsystem_name = "multimodalinput" 151} 152