1# Copyright (C) 2021 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. 13import("//build/test.gni") 14import("//foundation/filemanagement/dfs_service/distributedfile.gni") 15 16module_output_path = "storage_distributed_file_manager/distributedfiledaemon" 17 18config("module_private_config") { 19 visibility = [ ":*" ] 20 21 include_dirs = [ 22 "${services_path}/distributedfiledaemon/include", 23 "//third_party/json/include", 24 ] 25} 26 27ohos_unittest("device_manager_agent_test") { 28 module_out_path = module_output_path 29 30 sources = [ 31 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 32 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 33 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 34 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 35 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 36 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 37 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 38 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 39 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 40 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 41 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 42 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 43 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 44 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 45 ] 46 47 sources += [ "device/device_manager_agent_test.cpp" ] 48 49 configs = [ 50 ":module_private_config", 51 "${utils_path}:compiler_configs", 52 ] 53 54 deps = [ 55 "${utils_path}:libdistributedfileutils", 56 "//third_party/googletest:gtest_main", 57 ] 58 59 external_deps = [ 60 "ability_base:want", 61 "common_event_service:cesfwk_innerkits", 62 "dataclassification:data_transit_mgr", 63 "device_auth:deviceauth_sdk", 64 "device_manager:devicemanagersdk", 65 "dsoftbus:softbus_client", 66 "hilog:libhilog", 67 "init:libbegetutil", 68 "ipc:ipc_core", 69 "safwk:system_ability_fwk", 70 "samgr:samgr_proxy", 71 ] 72 73 defines = [ "private=public" ] 74} 75 76ohos_unittest("os_account_observer_test") { 77 module_out_path = module_output_path 78 79 sources = [ 80 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 81 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 82 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 83 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 84 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 85 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 86 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 87 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 88 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 89 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 90 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 91 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 92 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 93 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 94 ] 95 96 sources += [ "multiuser/os_account_observer_test.cpp" ] 97 98 configs = [ 99 ":module_private_config", 100 "${utils_path}:compiler_configs", 101 ] 102 103 deps = [ 104 "${utils_path}:libdistributedfileutils", 105 "//third_party/googletest:gtest_main", 106 ] 107 108 external_deps = [ 109 "ability_base:want", 110 "common_event_service:cesfwk_innerkits", 111 "dataclassification:data_transit_mgr", 112 "device_auth:deviceauth_sdk", 113 "device_manager:devicemanagersdk", 114 "dsoftbus:softbus_client", 115 "hilog:libhilog", 116 "init:libbegetutil", 117 "ipc:ipc_core", 118 "safwk:system_ability_fwk", 119 "samgr:samgr_proxy", 120 ] 121 122 defines = [ "private=public" ] 123} 124 125ohos_unittest("devsl_dispatcher_test") { 126 module_out_path = module_output_path 127 128 sources = [ 129 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 130 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 131 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 132 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 133 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 134 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 135 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 136 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 137 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 138 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 139 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 140 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 141 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 142 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 143 "network/devsl_dispatcher_test.cpp", 144 ] 145 146 configs = [ 147 ":module_private_config", 148 "${utils_path}:compiler_configs", 149 ] 150 151 deps = [ 152 "${utils_path}:libdistributedfileutils", 153 "//third_party/googletest:gtest_main", 154 ] 155 156 external_deps = [ 157 "ability_base:want", 158 "common_event_service:cesfwk_innerkits", 159 "dataclassification:data_transit_mgr", 160 "device_auth:deviceauth_sdk", 161 "device_manager:devicemanagersdk", 162 "dsoftbus:softbus_client", 163 "hilog:libhilog", 164 "init:libbegetutil", 165 "ipc:ipc_core", 166 "safwk:system_ability_fwk", 167 "samgr:samgr_proxy", 168 ] 169 170 defines = [ "private=public" ] 171} 172 173ohos_unittest("kernel_talker_test") { 174 module_out_path = module_output_path 175 176 sources = [ 177 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 178 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 179 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 180 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 181 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 182 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 183 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 184 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 185 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 186 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 187 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 188 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 189 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 190 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 191 "network/kernel_talker_test.cpp", 192 ] 193 194 configs = [ 195 ":module_private_config", 196 "${utils_path}:compiler_configs", 197 ] 198 199 deps = [ 200 "${utils_path}:libdistributedfileutils", 201 "//third_party/googletest:gtest_main", 202 ] 203 204 external_deps = [ 205 "ability_base:want", 206 "common_event_service:cesfwk_innerkits", 207 "dataclassification:data_transit_mgr", 208 "device_auth:deviceauth_sdk", 209 "device_manager:devicemanagersdk", 210 "dsoftbus:softbus_client", 211 "hilog:libhilog", 212 "init:libbegetutil", 213 "ipc:ipc_core", 214 "safwk:system_ability_fwk", 215 "samgr:samgr_proxy", 216 ] 217 218 defines = [ "private=public" ] 219} 220 221ohos_unittest("session_pool_test") { 222 module_out_path = module_output_path 223 224 sources = [ 225 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 226 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 227 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 228 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 229 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 230 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 231 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 232 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 233 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 234 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 235 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 236 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 237 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 238 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 239 "network/session_pool_test.cpp", 240 ] 241 242 configs = [ 243 ":module_private_config", 244 "${utils_path}:compiler_configs", 245 ] 246 247 deps = [ 248 "${utils_path}:libdistributedfileutils", 249 "//third_party/googletest:gtest_main", 250 ] 251 252 external_deps = [ 253 "ability_base:want", 254 "common_event_service:cesfwk_innerkits", 255 "dataclassification:data_transit_mgr", 256 "device_auth:deviceauth_sdk", 257 "device_manager:devicemanagersdk", 258 "dsoftbus:softbus_client", 259 "hilog:libhilog", 260 "init:libbegetutil", 261 "ipc:ipc_core", 262 "safwk:system_ability_fwk", 263 "samgr:samgr_proxy", 264 ] 265 266 defines = [ "private=public" ] 267} 268 269ohos_unittest("softbus_agent_test") { 270 module_out_path = module_output_path 271 272 sources = [ 273 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 274 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 275 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 276 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 277 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 278 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 279 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 280 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 281 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 282 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 283 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 284 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 285 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 286 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 287 "network/softbus_agent_test.cpp", 288 ] 289 290 configs = [ 291 ":module_private_config", 292 "${utils_path}:compiler_configs", 293 ] 294 295 deps = [ 296 "${utils_path}:libdistributedfileutils", 297 "//third_party/googletest:gtest_main", 298 ] 299 300 external_deps = [ 301 "ability_base:want", 302 "common_event_service:cesfwk_innerkits", 303 "dataclassification:data_transit_mgr", 304 "device_auth:deviceauth_sdk", 305 "device_manager:devicemanagersdk", 306 "dsoftbus:softbus_client", 307 "hilog:libhilog", 308 "init:libbegetutil", 309 "ipc:ipc_core", 310 "safwk:system_ability_fwk", 311 "samgr:samgr_proxy", 312 ] 313 314 defines = [ "private=public" ] 315} 316 317ohos_unittest("softbus_session_dispatcher_test") { 318 module_out_path = module_output_path 319 320 sources = [ 321 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 322 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 323 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 324 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 325 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 326 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 327 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 328 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 329 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 330 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 331 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 332 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 333 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 334 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 335 "network/softbus_session_dispatcher_test.cpp", 336 ] 337 338 configs = [ 339 ":module_private_config", 340 "${utils_path}:compiler_configs", 341 ] 342 343 deps = [ 344 "${utils_path}:libdistributedfileutils", 345 "//third_party/googletest:gtest_main", 346 ] 347 348 external_deps = [ 349 "ability_base:want", 350 "common_event_service:cesfwk_innerkits", 351 "dataclassification:data_transit_mgr", 352 "device_auth:deviceauth_sdk", 353 "device_manager:devicemanagersdk", 354 "dsoftbus:softbus_client", 355 "hilog:libhilog", 356 "init:libbegetutil", 357 "ipc:ipc_core", 358 "safwk:system_ability_fwk", 359 "samgr:samgr_proxy", 360 ] 361 362 defines = [ "private=public" ] 363} 364 365ohos_unittest("softbus_session_test") { 366 module_out_path = module_output_path 367 368 sources = [ 369 "${services_path}/distributedfiledaemon/src/device/device_info.cpp", 370 "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", 371 "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", 372 "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", 373 "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", 374 "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", 375 "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", 376 "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", 377 "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", 378 "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", 379 "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", 380 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", 381 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", 382 "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", 383 "network/softbus_session_test.cpp", 384 ] 385 386 configs = [ 387 ":module_private_config", 388 "${utils_path}:compiler_configs", 389 ] 390 391 deps = [ 392 "${utils_path}:libdistributedfileutils", 393 "//third_party/googletest:gtest_main", 394 ] 395 396 external_deps = [ 397 "ability_base:want", 398 "common_event_service:cesfwk_innerkits", 399 "dataclassification:data_transit_mgr", 400 "device_auth:deviceauth_sdk", 401 "device_manager:devicemanagersdk", 402 "dsoftbus:softbus_client", 403 "hilog:libhilog", 404 "init:libbegetutil", 405 "ipc:ipc_core", 406 "safwk:system_ability_fwk", 407 "samgr:samgr_proxy", 408 ] 409 410 defines = [ "private=public" ] 411} 412 413group("unittest") { 414 testonly = true 415 deps = [ 416 ":device_manager_agent_test", 417 ":devsl_dispatcher_test", 418 ":kernel_talker_test", 419 ":os_account_observer_test", 420 ":session_pool_test", 421 ":softbus_agent_test", 422 ":softbus_session_dispatcher_test", 423 ":softbus_session_test", 424 ] 425} 426