1# Copyright (c) 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("../../../multimodalinput_mini.gni") 16 17module_output_path = "input/input" 18 19ohos_unittest("PreferencesManagerTestWithMock") { 20 module_out_path = module_output_path 21 22 configs = [ "${mmi_path}:coverage_flags" ] 23 24 cflags = [ 25 "-Dprivate=public", 26 "-Dprotected=public", 27 ] 28 29 include_dirs = [ 30 "${mmi_path}/service/connect_manager/include", 31 "${mmi_path}/service/delegate_task/include", 32 "${mmi_path}/service/device_config/include", 33 "${mmi_path}/service/device_manager/include", 34 "${mmi_path}/service/device_state_manager/include", 35 "${mmi_path}/service/dfx/include", 36 "${mmi_path}/service/display_state_manager/include", 37 "${mmi_path}/service/event_dispatch/include", 38 "${mmi_path}/service/event_handler/include", 39 "${mmi_path}/service/fingersense_wrapper/include", 40 "${mmi_path}/service/gesturesense_wrapper/include", 41 "${mmi_path}/service/interceptor/include", 42 "${mmi_path}/service/key_command/include", 43 "${mmi_path}/service/key_event_normalize/include", 44 "${mmi_path}/service/module_loader/include", 45 "${mmi_path}/service/product_property_config/include", 46 "${mmi_path}/service/custom_config_parser/include", 47 "${mmi_path}/util/json_parser/include", 48 ] 49 50 sources = [ 51 "${mmi_path}/service/module_loader/src/multimodal_input_preferences_manager.cpp", 52 "src/multimodal_input_preferences_manager_test_with_mock.cpp", 53 ] 54 55 deps = [ 56 "${mmi_path}/util:libmmi-util", 57 "${mmi_path}/service/custom_config_parser:mmi_custom_config_parser", 58 ] 59 60 external_deps = [ 61 "cJSON:cjson", 62 "googletest:gmock_main", 63 "googletest:gtest_main", 64 "hilog:libhilog", 65 "init:libbegetutil", 66 "libxml2:libxml2", 67 "preferences:native_preferences", 68 "c_utils:utils", 69 "hilog:libhilog", 70 ] 71} 72 73group("ModuleLoaderTests") { 74 testonly = true 75 deps = [ ":PreferencesManagerTestWithMock" ] 76} 77