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