1# Copyright (c) 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("//base/msdp/device_status/device_status.gni") 15import("//build/test.gni") 16 17module_output_path = "${device_status_part_name}/devicestatussrv" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "include", 24 "//utils/system/safwk/native/include", 25 "//foundation/distributeddatamgr/distributeddatamgr/frameworks/innerkitsimpl/rdb/include", 26 ] 27} 28 29ohos_unittest("test_devicestatus_service") { 30 module_out_path = module_output_path 31 32 sources = [ "src/devicestatus_service_test.cpp" ] 33 34 configs = [ 35 "${device_status_utils_path}:devicestatus_utils_config", 36 ":module_private_config", 37 ] 38 39 deps = [ 40 "${device_status_interfaces_path}/innerkits:devicestatus_client", 41 "${device_status_service_path}:devicestatus_service", 42 "//drivers/peripheral/sensor/hal:hdi_sensor", 43 "//foundation/aafwk/standard/frameworks/kits/appkit:appkit_native", 44 "//third_party/googletest:gtest_main", 45 "//utils/native/base:utils", 46 ] 47 48 external_deps = [ 49 "ability_base:base", 50 "ability_base:want", 51 "ability_runtime:intent", 52 "bundle_framework:appexecfwk_base", 53 "bundle_framework:appexecfwk_core", 54 "ces_standard:cesfwk_innerkits", 55 "eventhandler:libeventhandler", 56 "hiviewdfx_hilog_native:libhilog", 57 "ipc:ipc_core", 58 "safwk:system_ability_fwk", 59 "samgr_standard:samgr_proxy", 60 ] 61} 62 63ohos_unittest("DevicestatusAgentTest") { 64 module_out_path = module_output_path 65 include_dirs = [ "//base/msdp/devicestatus/interfaces/innerkits/include" ] 66 67 sources = [ "src/devicestatus_agent_test.cpp" ] 68 69 configs = [ 70 "${device_status_utils_path}:devicestatus_utils_config", 71 ":module_private_config", 72 ] 73 74 deps = [ 75 "//base/msdp/device_status/frameworks/native/src:deviceagent", 76 "//base/msdp/device_status/services:devicestatus_service", 77 "//third_party/googletest:gtest_main", 78 "//utils/native/base:utils", 79 ] 80 external_deps = [ 81 "hiviewdfx_hilog_native:libhilog", 82 "ipc:ipc_core", 83 "safwk:system_ability_fwk", 84 "samgr_standard:samgr_proxy", 85 ] 86} 87 88group("unittest") { 89 testonly = true 90 deps = [] 91 92 deps += [ 93 ":DevicestatusAgentTest", 94 ":test_devicestatus_service", 95 ] 96} 97