1# Copyright (C) 2024 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_sync_service_cycle_task_test") { 18 module_out_path = "dfs_service/dfs_service" 19 20 sources = [ 21 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp", 22 "${distributedfile_path}/test/mock/cloud_file_kit_mock.cpp", 23 "${distributedfile_path}/test/unittests/cloudsync_sa/mock/parameters.cpp", 24 "${services_path}/cloudsyncservice/src/cycle_task/cycle_task.cpp", 25 "${services_path}/cloudsyncservice/src/cycle_task/cycle_task_runner.cpp", 26 "${services_path}/cloudsyncservice/src/cycle_task/tasks/database_backup_task.cpp", 27 "${services_path}/cloudsyncservice/src/cycle_task/tasks/optimize_cache_task.cpp", 28 "${services_path}/cloudsyncservice/src/cycle_task/tasks/optimize_storage_task.cpp", 29 "${services_path}/cloudsyncservice/src/cycle_task/tasks/periodic_check_task.cpp", 30 "${services_path}/cloudsyncservice/src/cycle_task/tasks/report_statistics_task.cpp", 31 "${services_path}/cloudsyncservice/src/cycle_task/tasks/save_subscription_task.cpp", 32 "cloud_sync_service_cycle_task_test.cpp", 33 ] 34 35 include_dirs = [ 36 "${clouddisk_database_path}/include", 37 "${distributedfile_path}/test/mock", 38 "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include", 39 "${distributedfile_path}/test/unittests/cloudsync_sa/mock/", 40 "${services_path}/cloudsyncservice/include", 41 "${services_path}/cloudsyncservice/include/cycle_task", 42 "${services_path}/cloudsyncservice/include/cycle_task/tasks", 43 ] 44 45 deps = [ 46 "${clouddisk_database_path}:clouddisk_database", 47 "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit", 48 "${utils_path}:libdistributedfiledentry", 49 "${utils_path}:libdistributedfileutils", 50 ] 51 52 external_deps = [ 53 "ability_base:want", 54 "ability_base:zuri", 55 "ability_runtime:dataobs_manager", 56 "c_utils:utils", 57 "common_event_service:cesfwk_innerkits", 58 "dfs_service:cloudsync_kit_inner", 59 "ffrt:libffrt", 60 "googletest:gmock", 61 "googletest:gtest", 62 "hilog:libhilog", 63 "hisysevent:libhisysevent", 64 "hitrace:hitrace_meter", 65 "ipc:ipc_single", 66 "libfuse:libfuse", 67 "os_account:os_account_innerkits", 68 "preferences:native_preferences", 69 "relational_store:native_rdb", 70 "safwk:system_ability_fwk", 71 "samgr:samgr_proxy", 72 ] 73 74 defines = [ 75 "private=public", 76 "protected=public", 77 "LOG_DOMAIN=0xD004307", 78 "LOG_TAG=\"CLOUDSYNC_TEST\"", 79 ] 80 81 if (cloudsync_service_hicollie_enable) { 82 external_deps += [ "hicollie:libhicollie" ] 83 defines += [ "HICOLLIE_ENABLE" ] 84 } 85 if (cloudsync_service_resource_schedule) { 86 external_deps += [ "resource_schedule_service:ressched_client" ] 87 defines += [ "CLOUDSYNC_SERVICE_RESOURCE_SCHEDULE" ] 88 } 89 use_exceptions = true 90} 91 92group("cloudsync_sa_cycle_task_test") { 93 testonly = true 94 deps = [ ":cloud_sync_service_cycle_task_test" ] 95} 96