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("//foundation/multimodalinput/input/multimodalinput_mini.gni") 16 17defines = input_default_defines 18 19config("mmi_libudev_public_config") { 20 include_dirs = [ "include" ] 21} 22 23config("mmi_libudev_config") { 24 include_dirs = [ "${mmi_path}/util/common/include" ] 25} 26 27ohos_static_library("mmi_libudev") { 28 public_configs = [ ":mmi_libudev_public_config" ] 29 configs = [ ":mmi_libudev_config" ] 30 31 sources = [ "src/udev_device.cpp" ] 32 stack_protector_ret = true 33 sanitize = { 34 cfi = true 35 cfi_cross_dso = true 36 debug = false 37 } 38 external_deps = [ "hilog:libhilog" ] 39 40 part_name = "input" 41 subsystem_name = "multimodalinput" 42} 43 44import("//build/test.gni") 45output_path = "multimodalinput/mmi_unit_out" 46 47group("test") { 48 testonly = true 49 deps = [ ":libudev-test" ] 50} 51 52ohos_unittest("libudev-test") { 53 module_out_path = output_path 54 include_dirs = [ 55 "${mmi_path}/test/unittest/standalone/include", 56 "//third_party/libevdev", 57 ] 58 59 configs = [ 60 ":mmi_libudev_config", 61 ":mmi_libudev_public_config", 62 ] 63 64 sources = [ 65 "src/udev_device.cpp", 66 "test/custom_udev_test.cpp", 67 ] 68 69 deps = [ 70 "//third_party/googletest:gmock_main", 71 "//third_party/libevdev", 72 ] 73} 74 75ohos_unittest("e2e-libudev-test") { 76 module_out_path = output_path 77 include_dirs = [ "//third_party/libevdev" ] 78 79 sources = [ "test/e2e_udev_test.cpp" ] 80 81 deps = [ 82 "${mmi_path}/frameworks/proxy:libmmi-client", 83 "//third_party/googletest:gmock_main", 84 "//third_party/libevdev", 85 ] 86} 87