# Copyright (C) 2023-2024 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("fuse_manager_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp", "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp", "fuse_manager_test.cpp", ] cloud_disk = [ "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp", ] sources += cloud_disk include_dirs = [ "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include", "${distributedfile_path}/services/cloudfiledaemon/include", "${distributedfile_path}/services/cloudfiledaemon/include/fuse_manager", "${services_path}/cloudfiledaemon/include/cloud_disk/", "${distributedfile_path}/adapter/cloud_adapter_example/include", "${clouddisk_database_path}/include", "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include", "${media_library_path}/interfaces/inner_api/media_library_helper/include", "${media_library_path}/frameworks/utils/include", ] deps = [ "${clouddisk_database_path}:clouddisk_database", "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner", "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", "${utils_path}:libdistributedfiledentry", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:zuri", "ability_runtime:dataobs_manager", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "init:libbegetutil", "ipc:ipc_single", "libfuse:libfuse", "relational_store:native_rdb", ] defines = [ "private=public", "LOG_DOMAIN=0xD004308", "LOG_TAG=\"CloudFileDaemon\"", ] if (cloudsync_service_hicollie_enable) { external_deps += [ "hicollie:libhicollie" ] defines += [ "HICOLLIE_ENABLE" ] } use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("cloud_daemon_statistic_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp", "cloud_daemon_statistic_test.cpp", ] cloud_disk = [ "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp", ] sources += cloud_disk include_dirs = [ "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include", "${distributedfile_path}/services/cloudfiledaemon/include", "${distributedfile_path}/services/cloudfiledaemon/include/fuse_manager", "${services_path}/cloudfiledaemon/include/cloud_disk/", "${distributedfile_path}/adapter/cloud_adapter_example/include", "${clouddisk_database_path}/include", "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include", "${media_library_path}/interfaces/inner_api/media_library_helper/include", "${media_library_path}/frameworks/utils/include", ] deps = [ "${clouddisk_database_path}:clouddisk_database", "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner", "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", "${utils_path}:libdistributedfiledentry", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:zuri", "ability_runtime:dataobs_manager", "ffrt:libffrt", "hilog:libhilog", "hitrace:hitrace_meter", "init:libbegetutil", "ipc:ipc_single", "libfuse:libfuse", "relational_store:native_rdb", ] defines = [ "private=public", "LOG_DOMAIN=0xD004308", "LOG_TAG=\"CloudFileDaemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("cloud_daemon_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/cloud_daemon_statistic.cpp", "${distributedfile_path}/services/cloudfiledaemon/src/fuse_manager/fuse_manager.cpp", "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon.cpp", "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp", "cloud_daemon_test.cpp", ] cloud_disk = [ "${services_path}/cloudfiledaemon/src/cloud_disk/database_manager.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_base.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_cloud.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/file_operations_local.cpp", "${services_path}/cloudfiledaemon/src/cloud_disk/fuse_operations.cpp", ] sources += cloud_disk include_dirs = [ "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include", "${distributedfile_path}/services/cloudfiledaemon/include", "${services_path}/cloudfiledaemon/include/cloud_disk/", "${distributedfile_path}/adapter/cloud_adapter_example/include", "${clouddisk_database_path}/include", "${media_library_path}/frameworks/innerkitsimpl/media_library_helper/include", "${media_library_path}/interfaces/inner_api/media_library_helper/include", "${media_library_path}/frameworks/utils/include", ] deps = [ "${clouddisk_database_path}:clouddisk_database", "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner", "${utils_path}:libdistributedfiledentry", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:zuri", "ability_runtime:dataobs_manager", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "hitrace:hitrace_meter", "ipc:ipc_single", "libfuse:libfuse", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "private=public", "LOG_DOMAIN=0xD004308", "LOG_TAG=\"CloudFileDaemon\"", ] if (cloudsync_service_hicollie_enable) { external_deps += [ "hicollie:libhicollie" ] defines += [ "HICOLLIE_ENABLE" ] } use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } ohos_unittest("cloud_daemon_stub_test") { module_out_path = "filemanagement/dfs_service" sources = [ "${distributedfile_path}/services/cloudfiledaemon/src/ipc/cloud_daemon_stub.cpp", "cloud_daemon_stub_test.cpp", ] include_dirs = [ "${distributedfile_path}/services/cloudfiledaemon/include", "${services_path}/cloudsyncservice/include/data_sync/", "${distributedfile_path}/adapter/cloud_adapter_example/include", ] deps = [ "${innerkits_native_path}/cloud_daemon_kit_inner:cloud_daemon_kit_inner", "${utils_path}:libdistributedfiledentry", "${utils_path}:libdistributedfileutils", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "libfuse:libfuse", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] defines = [ "private=public", "LOG_DOMAIN=0xD004308", "LOG_TAG=\"CloudFileDaemon\"", ] use_exceptions = true part_name = "dfs_service" subsystem_name = "filemanagement" } group("services_daemon_test") { testonly = true deps = [ ":cloud_daemon_statistic_test", ":cloud_daemon_stub_test", ":fuse_manager_test", ] }