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 "//base/msdp/device_status/libs/interface", 27 "//base/msdp/device_status/services/delegate_task/include", 28 ] 29} 30 31ohos_unittest("test_devicestatus_service") { 32 module_out_path = module_output_path 33 34 sources = [ "src/devicestatus_service_test.cpp" ] 35 36 configs = [ 37 "${device_status_utils_path}:devicestatus_utils_config", 38 ":module_private_config", 39 ] 40 41 deps = [ 42 "${ability_runtime_path}/frameworks/native/appkit:appkit_native", 43 "${device_status_frameworks_path}/js/napi:stationary", 44 "${device_status_interfaces_path}/innerkits:devicestatus_client", 45 "${device_status_service_path}:devicestatus_service", 46 "//drivers/peripheral/sensor/hal:hdi_sensor", 47 "//third_party/googletest:gtest_main", 48 ] 49 50 external_deps = [ 51 "ability_base:base", 52 "ability_base:want", 53 "access_token:libaccesstoken_sdk", 54 "bundle_framework:appexecfwk_base", 55 "bundle_framework:appexecfwk_core", 56 "c_utils:utils", 57 "common_event_service:cesfwk_innerkits", 58 "eventhandler:libeventhandler", 59 "hiviewdfx_hilog_native:libhilog", 60 "ipc:ipc_core", 61 "relational_store:native_rdb", 62 "safwk:system_ability_fwk", 63 "samgr:samgr_proxy", 64 ] 65} 66 67ohos_unittest("DevicestatusAgentTest") { 68 module_out_path = module_output_path 69 include_dirs = [ "//base/msdp/devicestatus/interfaces/innerkits/include" ] 70 71 sources = [ "src/devicestatus_agent_test.cpp" ] 72 73 configs = [ 74 "${device_status_utils_path}:devicestatus_utils_config", 75 ":module_private_config", 76 ] 77 78 deps = [ 79 "//base/msdp/device_status/frameworks/native/src:deviceagent", 80 "//base/msdp/device_status/services:devicestatus_service", 81 "//third_party/googletest:gtest_main", 82 ] 83 external_deps = [ 84 "c_utils:utils", 85 "hiviewdfx_hilog_native:libhilog", 86 "ipc:ipc_core", 87 "safwk:system_ability_fwk", 88 "samgr:samgr_proxy", 89 ] 90} 91 92ohos_unittest("DevicestatusClientTest") { 93 module_out_path = module_output_path 94 include_dirs = [ "//base/msdp/devicestatus/interfaces/innerkits/include" ] 95 96 sources = [ "src/devicestatus_client_test.cpp" ] 97 98 configs = [ 99 "${device_status_utils_path}:devicestatus_utils_config", 100 ":module_private_config", 101 ] 102 103 deps = [ 104 "//base/msdp/device_status/frameworks/native/src:deviceagent", 105 "//base/msdp/device_status/interfaces/innerkits:devicestatus_client", 106 "//base/msdp/device_status/services:devicestatus_service", 107 "//third_party/googletest:gtest_main", 108 ] 109 external_deps = [ 110 "c_utils:utils", 111 "hiviewdfx_hilog_native:libhilog", 112 "ipc:ipc_core", 113 "safwk:system_ability_fwk", 114 "samgr:samgr_proxy", 115 ] 116} 117 118group("unittest") { 119 testonly = true 120 deps = [] 121 122 deps += [ 123 ":DevicestatusAgentTest", 124 ":DevicestatusClientTest", 125 ":test_devicestatus_service", 126 ] 127} 128