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("distributed_file_daemon_test") { 18 module_out_path = "filemanagement/dfs_service" 19 20 sources = [ 21 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 22 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 23 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 24 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 25 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 26 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 27 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 28 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 29 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 30 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 31 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 32 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 33 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 34 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 35 "daemon_test.cpp", 36 ] 37 38 include_dirs = [ 39 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 40 "${services_path}/distributedfiledaemon/include", 41 "//third_party/libfuse/include", 42 "//third_party/libfuse/lib", 43 ] 44 45 deps = [ 46 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 47 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 48 "${utils_path}:libdistributedfileutils", 49 "//third_party/googletest:gmock_main", 50 "//third_party/googletest:gtest_main", 51 "//third_party/libfuse:libfuse", 52 ] 53 54 external_deps = [ 55 "ability_base:want", 56 "common_event_service:cesfwk_innerkits", 57 "dataclassification:data_transit_mgr", 58 "device_auth:deviceauth_sdk", 59 "device_manager:devicemanagersdk", 60 "dsoftbus:softbus_client", 61 "hilog:libhilog", 62 "init:libbegetutil", 63 "ipc:ipc_core", 64 "safwk:system_ability_fwk", 65 "samgr:samgr_proxy", 66 ] 67 68 defines = [ 69 "private=public", 70 "LOG_TAG=\"distributedfile_daemon\"", 71 ] 72 73 use_exceptions = true 74 part_name = "dfs_service" 75 subsystem_name = "filemanagement" 76} 77 78ohos_unittest("distributed_file_daemon_stub_test") { 79 module_out_path = "filemanagement/dfs_service" 80 81 sources = [ 82 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 83 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 84 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 85 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 86 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 87 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 88 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 89 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 90 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 91 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 92 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 93 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 94 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 95 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 96 "daemon_stub_test.cpp", 97 ] 98 99 include_dirs = [ 100 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 101 "${services_path}/distributedfiledaemon/include", 102 "//third_party/libfuse/include", 103 "//third_party/libfuse/lib", 104 ] 105 106 deps = [ 107 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 108 "${services_path}/distributedfiledaemon:libdistributedfiledaemon", 109 "${utils_path}:libdistributedfileutils", 110 "//third_party/googletest:gmock_main", 111 "//third_party/googletest:gtest_main", 112 "//third_party/libfuse:libfuse", 113 ] 114 115 external_deps = [ 116 "ability_base:want", 117 "common_event_service:cesfwk_innerkits", 118 "dataclassification:data_transit_mgr", 119 "device_auth:deviceauth_sdk", 120 "device_manager:devicemanagersdk", 121 "dsoftbus:softbus_client", 122 "hilog:libhilog", 123 "init:libbegetutil", 124 "ipc:ipc_core", 125 "safwk:system_ability_fwk", 126 "samgr:samgr_proxy", 127 ] 128 129 defines = [ 130 "private=public", 131 "LOG_TAG=\"distributedfile_daemon\"", 132 ] 133 134 use_exceptions = true 135 part_name = "dfs_service" 136 subsystem_name = "filemanagement" 137} 138 139ohos_unittest("daemon_manager_impl_test") { 140 module_out_path = "filemanagement/dfs_service" 141 142 sources = [ 143 "${distributedfile_path}/utils/log/src/utils_log.cpp", 144 "daemon_manager_impl_test.cpp", 145 ] 146 147 include_dirs = [ 148 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 149 "${distributedfile_path}/test/unittests/distributed_file_daemon/include", 150 "${services_path}/distributedfiledaemon/include", 151 "//third_party/libfuse/include", 152 "//third_party/libfuse/lib", 153 ] 154 155 deps = [ 156 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 157 "${utils_path}:libdistributedfileutils", 158 "//third_party/googletest:gmock_main", 159 "//third_party/googletest:gtest_main", 160 ] 161 162 external_deps = [ 163 "device_manager:devicemanagersdk", 164 "hilog:libhilog", 165 "ipc:ipc_single", 166 ] 167 168 defines = [ 169 "private=public", 170 "LOG_TAG=\"distributedfile_daemon\"", 171 ] 172 173 use_exceptions = true 174 part_name = "dfs_service" 175 subsystem_name = "filemanagement" 176} 177 178ohos_unittest("daemon_manager_test") { 179 module_out_path = "filemanagement/dfs_service" 180 181 sources = [ 182 "${distributedfile_path}/utils/log/src/utils_log.cpp", 183 "daemon_manager_test.cpp", 184 ] 185 186 include_dirs = [ 187 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 188 "${distributedfile_path}/test/unittests/distributed_file_daemon/include", 189 "${services_path}/distributedfiledaemon/include", 190 ] 191 192 deps = [ 193 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 194 "${utils_path}:libdistributedfileutils", 195 "//third_party/googletest:gmock_main", 196 "//third_party/googletest:gtest_main", 197 ] 198 199 external_deps = [ 200 "device_manager:devicemanagersdk", 201 "hilog:libhilog", 202 "ipc:ipc_core", 203 ] 204 205 defines = [ 206 "private=public", 207 "LOG_TAG=\"distributedfile_daemon\"", 208 ] 209 210 use_exceptions = true 211 part_name = "dfs_service" 212 subsystem_name = "filemanagement" 213} 214 215ohos_unittest("daemon_service_proxy_test") { 216 module_out_path = "filemanagement/dfs_service" 217 218 sources = [ 219 "${distributedfile_path}/utils/log/src/utils_log.cpp", 220 "daemon_service_proxy_test.cpp", 221 ] 222 223 include_dirs = [ 224 "${distributedfile_path}/frameworks/native/distributed_file_inner/include", 225 "${distributedfile_path}/test/unittests/distributed_file_daemon/include", 226 "${services_path}/distributedfiledaemon/include", 227 ] 228 229 deps = [ 230 "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", 231 "${utils_path}:libdistributedfileutils", 232 "//third_party/googletest:gmock_main", 233 "//third_party/googletest:gtest_main", 234 ] 235 236 external_deps = [ 237 "device_manager:devicemanagersdk", 238 "hilog:libhilog", 239 "ipc:ipc_core", 240 ] 241 242 defines = [ 243 "private=public", 244 "LOG_TAG=\"distributedfile_daemon\"", 245 ] 246 247 use_exceptions = true 248 part_name = "dfs_service" 249 subsystem_name = "filemanagement" 250} 251 252group("distributed_daemon_test") { 253 testonly = true 254 255 deps = [ 256 ":daemon_manager_impl_test", 257 ":daemon_manager_test", 258 ":daemon_service_proxy_test", 259 ":distributed_file_daemon_stub_test", 260 ":distributed_file_daemon_test", 261 ] 262} 263