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("//build/ohos.gni") 15import("//build/ohos_var.gni") 16import("//build/test.gni") 17import("//foundation/ability/dmsfwk/dmsfwk.gni") 18 19module_output_path = "dmsfwk/distributed_base_svr_test" 20 21distributed_service = "//foundation/ability/dmsfwk/services" 22 23base_configs = [ "${distributed_service}/base:distributed_sched_config" ] 24 25config("test_config") { 26 visibility = [ ":*" ] 27 include_dirs = [ "//foundation/ability/dmsfwk/utils/native/include" ] 28} 29 30base_external_deps = [ 31 "c_utils:utils", 32 "device_manager:devicemanagersdk", 33 "eventhandler:libeventhandler", 34 "hiviewdfx_hilog_native:libhilog", 35 "init:libbegetutil", 36 "ipc:ipc_core", 37 "safwk:system_ability_fwk", 38 "samgr:samgr_proxy", 39] 40 41base_public_deps = [ 42 "//foundation/ability/dmsfwk/services/base:dmsbaseinner", 43 "//third_party/googletest:gmock_main", 44 "//third_party/googletest:gtest_main", 45 "//third_party/libxml2:libxml2", 46] 47 48ohos_unittest("dmsbasetest") { 49 module_out_path = module_output_path 50 sources = [ 51 "${distributed_service}/base/src/adapter/dnetwork_adapter.cpp", 52 "${distributed_service}/base/src/deviceManager/dms_device_info.cpp", 53 "${distributed_service}/base/src/distributed_device_node_listener.cpp", 54 "${distributed_service}/base/src/dtbschedmgr_device_info_storage.cpp", 55 "unittest/deviceManager/dms_device_info_test.cpp", 56 "unittest/dfx/dms_hisysevent_report_test.cpp", 57 "unittest/dms_network_adapter_test.cpp", 58 "unittest/dtbschedmgr_device_info_storage_test.cpp", 59 ] 60 configs = [ 61 ":test_config", 62 "//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags", 63 ] 64 configs += base_configs 65 external_deps = base_external_deps 66 public_deps = base_public_deps 67 part_name = "dmsfwk" 68 subsystem_name = "ability" 69} 70 71group("unittest") { 72 testonly = true 73 deps = [ ":dmsbasetest" ] 74} 75