1# Copyright (c) 2022-2023 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("../../../../device_status.gni") 16 17module_output_path = "${device_status_part_name}/devicestatussrv" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "include", 24 "${device_status_root_path}/libs/interface", 25 "${device_status_service_path}/delegate_task/include", 26 "${device_status_service_path}/context/include", 27 "${device_status_service_path}/communication/service/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 "//third_party/googletest:gtest_main", 46 ] 47 48 external_deps = [ 49 "ability_base:base", 50 "ability_base:want", 51 "access_token:libaccesstoken_sdk", 52 "bundle_framework:appexecfwk_base", 53 "bundle_framework:appexecfwk_core", 54 "c_utils:utils", 55 "common_event_service:cesfwk_innerkits", 56 "eventhandler:libeventhandler", 57 "hilog:libhilog", 58 "image_framework:image_native", 59 "input:libmmi-client", 60 "ipc:ipc_single", 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 = [ "${device_status_interfaces_path}/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 "../../../../frameworks/native/src:deviceagent", 80 "//third_party/googletest:gtest_main", 81 ] 82 external_deps = [ 83 "c_utils:utils", 84 "hilog:libhilog", 85 "ipc:ipc_single", 86 "safwk:system_ability_fwk", 87 "samgr:samgr_proxy", 88 ] 89} 90 91group("unittest") { 92 testonly = true 93 deps = [] 94 95 deps += [ 96 ":DeviceStatusAgentTest", 97 ":test_devicestatus_service", 98 ] 99} 100