1# Copyright (C) 2023 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_daemon_manager_test") {
18  module_out_path = "filemanagement/dfs_service"
19
20  sources = [
21    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_manager_impl.cpp",
22    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_service_proxy.cpp",
23    "../../mock/cloud_daemon_manager_mock.cpp",
24    "cloud_daemon_manager_test.cpp",
25  ]
26
27  include_dirs = [
28    "${distributedfile_path}/utils/log/include",
29    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/include",
30    "${distributedfile_path}/interfaces/inner_api/native/cloud_daemon_kit_inner",
31  ]
32
33  deps = [
34    "${services_path}/distributedfiledaemon:libdistributedfiledaemon",
35    "${utils_path}:libdistributedfileutils",
36    "//third_party/googletest:gmock_main",
37    "//third_party/googletest:gtest_main",
38  ]
39
40  external_deps = [
41    "c_utils:utils",
42    "hilog:libhilog",
43    "ipc:ipc_single",
44    "safwk:system_ability_fwk",
45    "samgr:samgr_proxy",
46  ]
47
48  defines = [
49    "private=public",
50    "LOG_DOMAIN=0xD004308",
51    "LOG_TAG=\"CLOUD_DAEMON_API\"",
52  ]
53
54  use_exceptions = true
55}
56
57ohos_unittest("cloud_daemon_manager_impl_test") {
58  module_out_path = "filemanagement/dfs_service"
59
60  sources = [
61    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_manager_impl.cpp",
62    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_service_proxy.cpp",
63    "cloud_daemon_manager_impl_test.cpp",
64  ]
65
66  include_dirs = [
67    "${distributedfile_path}/utils/log/include",
68    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/include",
69    "${distributedfile_path}/interfaces/inner_api/native/cloud_daemon_kit_inner",
70  ]
71
72  deps = [
73    "${services_path}/distributedfiledaemon:libdistributedfiledaemon",
74    "${utils_path}:libdistributedfileutils",
75    "//third_party/googletest:gmock_main",
76    "//third_party/googletest:gtest_main",
77  ]
78
79  external_deps = [
80    "c_utils:utils",
81    "hilog:libhilog",
82    "ipc:ipc_single",
83    "safwk:system_ability_fwk",
84    "samgr:samgr_proxy",
85  ]
86
87  defines = [
88    "private=public",
89    "LOG_DOMAIN=0xD004308",
90    "LOG_TAG=\"CLOUD_DAEMON_API\"",
91  ]
92
93  use_exceptions = true
94}
95
96ohos_unittest("cloud_daemon_service_proxy_test") {
97  module_out_path = "filemanagement/dfs_service"
98
99  sources = [
100    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/src/cloud_daemon_service_proxy.cpp",
101    "cloud_daemon_service_proxy_test.cpp",
102  ]
103
104  include_dirs = [
105    "${distributedfile_path}/utils/log/include",
106    "${distributedfile_path}/frameworks/native/cloud_daemon_kit_inner/include",
107    "${distributedfile_path}/interfaces/inner_api/native/cloud_daemon_kit_inner",
108    "${distributedfile_path}/test/unittests/cloud_daemon/include",
109    "../../../../../systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
110    "../../../../../communication/ipc/interfaces/innerkits/ipc_core/include",
111  ]
112
113  deps = [
114    "${utils_path}:libdistributedfileutils",
115    "//third_party/googletest:gmock_main",
116    "//third_party/googletest:gtest_main",
117  ]
118
119  external_deps = [
120    "c_utils:utils",
121    "hilog:libhilog",
122    "ipc:ipc_single",
123  ]
124
125  defines = [
126    "private=public",
127    "LOG_DOMAIN=0xD004308",
128    "LOG_TAG=\"CLOUD_DAEMON_API\"",
129  ]
130
131  use_exceptions = true
132}
133
134group("cloud_daemon_test") {
135  testonly = true
136
137  deps = [
138    ":cloud_daemon_manager_impl_test",
139    ":cloud_daemon_manager_test",
140    ":cloud_daemon_service_proxy_test",
141  ]
142}
143