1# Copyright (C) 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("//foundation/filemanagement/dfs_service/distributedfile.gni") 16 17ohos_unittest("cloud_daemon_manager_test") { 18 module_out_path = "dfs_service/dfs_service" 19 20 sources = [ 21 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_manager_impl.cpp", 22 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_service_proxy.cpp", 23 "../../mock/cloud_daemon_manager_mock.cpp", 24 "cloud_daemon_manager_test.cpp", 25 ] 26 27 include_dirs = [ 28 "${distributedfile_path}/utils/log/include", 29 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/include", 30 "${distributedfile_path}/interfaces/inner_api/native/cloud_daemon_kit_inner", 31 ] 32 33 deps = [ 34 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 35 "${utils_path}:libdistributedfileutils", 36 ] 37 38 external_deps = [ 39 "c_utils:utils", 40 "googletest:gmock_main", 41 "googletest:gtest_main", 42 "hilog:libhilog", 43 "ipc:ipc_single", 44 "safwk:system_ability_fwk", 45 "samgr:samgr_proxy", 46 ] 47 48 defines = [ 49 "private=public", 50 "LOG_DOMAIN=0xD004308", 51 "LOG_TAG=\"CLOUD_DAEMON_API\"", 52 ] 53 54 use_exceptions = true 55} 56 57ohos_unittest("cloud_daemon_manager_impl_test") { 58 module_out_path = "dfs_service/dfs_service" 59 60 sources = [ 61 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_manager_impl.cpp", 62 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_service_proxy.cpp", 63 "cloud_daemon_manager_impl_test.cpp", 64 ] 65 66 include_dirs = [ 67 "${distributedfile_path}/utils/log/include", 68 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/include", 69 "${distributedfile_path}/interfaces/inner_api/native/cloud_daemon_kit_inner", 70 ] 71 72 deps = [ 73 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 74 "${utils_path}:libdistributedfileutils", 75 ] 76 77 external_deps = [ 78 "c_utils:utils", 79 "googletest:gmock_main", 80 "googletest:gtest_main", 81 "hilog:libhilog", 82 "ipc:ipc_single", 83 "safwk:system_ability_fwk", 84 "samgr:samgr_proxy", 85 ] 86 87 defines = [ 88 "private=public", 89 "LOG_DOMAIN=0xD004308", 90 "LOG_TAG=\"CLOUD_DAEMON_API\"", 91 ] 92 if (dfs_service_feature_enable_cloud_adapter) { 93 defines += [ "CLOUD_ADAPTER_ENABLED" ] 94 } 95 use_exceptions = true 96} 97 98ohos_unittest("cloud_daemon_service_proxy_test") { 99 module_out_path = "dfs_service/dfs_service" 100 101 sources = [ 102 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_service_proxy.cpp", 103 "cloud_daemon_service_proxy_test.cpp", 104 ] 105 106 include_dirs = [ 107 "${distributedfile_path}/utils/log/include", 108 "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/include", 109 "${distributedfile_path}/interfaces/inner_api/native/cloud_daemon_kit_inner", 110 "${distributedfile_path}/test/unittests/cloud_daemon/include", 111 ] 112 113 deps = [ "${utils_path}:libdistributedfileutils" ] 114 115 external_deps = [ 116 "c_utils:utils", 117 "googletest:gmock_main", 118 "googletest:gtest_main", 119 "hilog:libhilog", 120 "ipc:ipc_single", 121 "samgr:samgr_proxy", 122 ] 123 124 defines = [ 125 "private=public", 126 "LOG_DOMAIN=0xD004308", 127 "LOG_TAG=\"CLOUD_DAEMON_API\"", 128 ] 129 130 use_exceptions = true 131} 132 133group("cloud_daemon_test") { 134 testonly = true 135 136 deps = [ 137 ":cloud_daemon_manager_impl_test", 138 ":cloud_daemon_manager_test", 139 ":cloud_daemon_service_proxy_test", 140 ] 141} 142