# Copyright (C) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("//foundation/filemanagement/dfs_service/distributedfile.gni") ohos_unittest("distributed_file_daemon_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${services_path}/distributedfiledaemon/src/device/device_info.cpp", "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", "daemon_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${services_path}/distributedfiledaemon/include", "//third_party/libfuse/include", "//third_party/libfuse/lib", ] deps = [ "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", "${services_path}/distributedfiledaemon:libdistributedfiledaemon", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/libfuse:libfuse", ] external_deps = [ "ability_base:want", "common_event_service:cesfwk_innerkits", "dataclassification:data_transit_mgr", "device_auth:deviceauth_sdk", "device_manager:devicemanagersdk", "dsoftbus:softbus_client", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("distributed_file_daemon_stub_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${services_path}/distributedfiledaemon/src/device/device_info.cpp", "${services_path}/distributedfiledaemon/src/device/device_manager_agent.cpp", "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp", "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp", "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp", "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp", "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp", "${services_path}/distributedfiledaemon/src/network/devsl_dispatcher.cpp", "${services_path}/distributedfiledaemon/src/network/kernel_talker.cpp", "${services_path}/distributedfiledaemon/src/network/network_agent_template.cpp", "${services_path}/distributedfiledaemon/src/network/session_pool.cpp", "${services_path}/distributedfiledaemon/src/network/softbus/softbus_agent.cpp", "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session.cpp", "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_dispatcher.cpp", "daemon_stub_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${services_path}/distributedfiledaemon/include", "//third_party/libfuse/include", "//third_party/libfuse/lib", ] deps = [ "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", "${services_path}/distributedfiledaemon:libdistributedfiledaemon", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", "//third_party/libfuse:libfuse", ] external_deps = [ "ability_base:want", "common_event_service:cesfwk_innerkits", "dataclassification:data_transit_mgr", "device_auth:deviceauth_sdk", "device_manager:devicemanagersdk", "dsoftbus:softbus_client", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("daemon_manager_impl_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/utils/log/src/utils_log.cpp", "daemon_manager_impl_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/test/unittests/distributed_file_daemon/include", "${services_path}/distributedfiledaemon/include", "//third_party/libfuse/include", "//third_party/libfuse/lib", ] deps = [ "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "device_manager:devicemanagersdk", "hilog:libhilog", "ipc:ipc_single", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("daemon_manager_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/utils/log/src/utils_log.cpp", "daemon_manager_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/test/unittests/distributed_file_daemon/include", "${services_path}/distributedfiledaemon/include", ] deps = [ "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "device_manager:devicemanagersdk", "hilog:libhilog", "ipc:ipc_core", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("daemon_service_proxy_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/utils/log/src/utils_log.cpp", "daemon_service_proxy_test.cpp", ] include_dirs = [ "${distributedfile_path}/frameworks/native/distributed_file_inner/include", "${distributedfile_path}/test/unittests/distributed_file_daemon/include", "${services_path}/distributedfiledaemon/include", ] deps = [ "${services_path}/distributedfiledaemon:distributed_file_daemon_kit_inner", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "device_manager:devicemanagersdk", "hilog:libhilog", "ipc:ipc_core", ] defines = [ "private=public", "LOG_TAG=\"distributedfile_daemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } group("distributed_daemon_test") { testonly = true deps = [ ":daemon_manager_impl_test", ":daemon_manager_test", ":daemon_service_proxy_test", ":distributed_file_daemon_stub_test", ":distributed_file_daemon_test", ] }