• 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_transport_manager_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/cloudsyncservice/transport/softbus_adapter_mock.cpp",
23    "${distributedfile_path}/test/mock/cloudsyncservice/transport/softbus_session_mock.cpp",
24    "${distributedfile_path}/test/mock/socket_mock.cpp",
25    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/parameters.cpp",
26    "${services_path}/cloudsyncservice/src/ipc/download_asset_callback_manager.cpp",
27    "${services_path}/cloudsyncservice/src/ipc/download_asset_callback_proxy.cpp",
28    "${services_path}/cloudsyncservice/src/transport/file_transfer_manager.cpp",
29    "${services_path}/cloudsyncservice/src/transport/message_handler.cpp",
30    "${services_path}/cloudsyncservice/src/transport/softbus/session_manager.cpp",
31    "file_transfer_manager_test.cpp",
32    "message_handler_test.cpp",
33    "softbus/session_manager_test.cpp",
34  ]
35
36  include_dirs = [
37    "${clouddisk_database_path}/include",
38    "${distributedfile_path}/test/mock",
39    "${distributedfile_path}/test/mock/cloudsyncservice/transport",
40    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
41    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/",
42    "${services_path}/cloudsyncservice/include",
43    "${services_path}/cloudsyncservice/include/transport",
44    "${services_path}/cloudsyncservice/include/transport/softbus",
45    "${services_path}/cloudfiledaemon/include/cloud_disk",
46    "${innerkits_native_path}/cloudsync_kit_inner",
47  ]
48
49  deps = [
50    "${clouddisk_database_path}:clouddisk_database",
51    "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit",
52    "${utils_path}:libdistributedfiledentry",
53    "${utils_path}:libdistributedfileutils",
54  ]
55
56  external_deps = [
57    "ability_base:want",
58    "ability_base:zuri",
59    "ability_runtime:dataobs_manager",
60    "app_file_service:sandbox_helper_native",
61    "c_utils:utils",
62    "common_event_service:cesfwk_innerkits",
63    "dfs_service:cloudsync_kit_inner",
64    "dsoftbus:softbus_client",
65    "ffrt:libffrt",
66    "googletest:gmock",
67    "googletest:gtest",
68    "hilog:libhilog",
69    "hisysevent:libhisysevent",
70    "hitrace:hitrace_meter",
71    "ipc:ipc_single",
72    "libfuse:libfuse",
73    "netmanager_base:net_conn_manager_if",
74    "os_account:os_account_innerkits",
75    "relational_store:native_rdb",
76    "safwk:system_ability_fwk",
77    "samgr:samgr_proxy",
78  ]
79
80  defines = [
81    "private=public",
82    "LOG_DOMAIN=0xD004307",
83    "LOG_TAG=\"CLOUDSYNC_TEST\"",
84  ]
85
86  if (cloudsync_service_hicollie_enable) {
87    external_deps += [ "hicollie:libhicollie" ]
88    defines += [ "HICOLLIE_ENABLE" ]
89  }
90  if (cloudsync_service_resource_schedule) {
91    external_deps += [ "resource_schedule_service:ressched_client" ]
92    defines += [ "CLOUDSYNC_SERVICE_RESOURCE_SCHEDULE" ]
93  }
94  use_exceptions = true
95}
96
97ohos_unittest("cloud_sync_service_transport_softbus_test") {
98  module_out_path = "dfs_service/dfs_service"
99
100  sources = [
101    "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp",
102    "${distributedfile_path}/test/mock/socket_mock.cpp",
103    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/parameters.cpp",
104    "${services_path}/cloudsyncservice/src/ipc/download_asset_callback_manager.cpp",
105    "${services_path}/cloudsyncservice/src/ipc/download_asset_callback_proxy.cpp",
106    "${services_path}/cloudsyncservice/src/transport/file_transfer_manager.cpp",
107    "${services_path}/cloudsyncservice/src/transport/message_handler.cpp",
108    "${services_path}/cloudsyncservice/src/transport/softbus/session_manager.cpp",
109    "${services_path}/cloudsyncservice/src/transport/softbus/softbus_adapter.cpp",
110    "${services_path}/cloudsyncservice/src/transport/softbus/softbus_session.cpp",
111    "softbus/softbus_adapter_test.cpp",
112    "softbus/softbus_session_test.cpp",
113  ]
114
115  include_dirs = [
116    "${clouddisk_database_path}/include",
117    "${distributedfile_path}/test/mock",
118    "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include",
119    "${distributedfile_path}/test/unittests/cloudsync_sa/mock/",
120    "${services_path}/cloudsyncservice/include",
121    "${services_path}/cloudsyncservice/include/transport",
122    "${services_path}/cloudsyncservice/include/transport/softbus",
123    "${services_path}/cloudfiledaemon/include/cloud_disk",
124    "${innerkits_native_path}/cloudsync_kit_inner",
125  ]
126
127  deps = [
128    "${clouddisk_database_path}:clouddisk_database",
129    "${innerkits_native_path}/cloud_file_kit_inner:cloudfile_kit",
130    "${utils_path}:libdistributedfiledentry",
131    "${utils_path}:libdistributedfileutils",
132  ]
133
134  external_deps = [
135    "ability_base:want",
136    "ability_base:zuri",
137    "ability_runtime:dataobs_manager",
138    "app_file_service:sandbox_helper_native",
139    "c_utils:utils",
140    "common_event_service:cesfwk_innerkits",
141    "dfs_service:cloudsync_kit_inner",
142    "dsoftbus:softbus_client",
143    "ffrt:libffrt",
144    "googletest:gmock",
145    "googletest:gtest",
146    "hilog:libhilog",
147    "hisysevent:libhisysevent",
148    "hitrace:hitrace_meter",
149    "ipc:ipc_single",
150    "libfuse:libfuse",
151    "netmanager_base:net_conn_manager_if",
152    "os_account:os_account_innerkits",
153    "relational_store:native_rdb",
154    "safwk:system_ability_fwk",
155    "samgr:samgr_proxy",
156  ]
157
158  defines = [
159    "private=public",
160    "protected=public",
161    "LOG_DOMAIN=0xD004307",
162    "LOG_TAG=\"CLOUDSYNC_TEST\"",
163  ]
164
165  if (cloudsync_service_hicollie_enable) {
166    external_deps += [ "hicollie:libhicollie" ]
167    defines += [ "HICOLLIE_ENABLE" ]
168  }
169  if (cloudsync_service_resource_schedule) {
170    external_deps += [ "resource_schedule_service:ressched_client" ]
171    defines += [ "CLOUDSYNC_SERVICE_RESOURCE_SCHEDULE" ]
172  }
173  if (dfs_service_feature_enable_cloud_adapter) {
174    defines += [ "CLOUD_ADAPTER_ENABLED" ]
175  }
176  use_exceptions = true
177}
178
179group("cloudsync_sa_transport_test") {
180  testonly = true
181  deps = [
182    ":cloud_sync_service_transport_manager_test",
183    ":cloud_sync_service_transport_softbus_test",
184  ]
185}
186