• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("dfsu_fd_guard_test") {
18  module_out_path = "filemanagement/dfs_service"
19
20  sources = [
21    "${utils_path}/system/src/dfsu_fd_guard.cpp",
22    "dfsu_fd_guard_test.cpp",
23  ]
24
25  include_dirs = [
26    "${utils_path}/system/include",
27    "${utils_path}/log/include",
28    "//foundation/multimedia/image_framework/mock/native/include/log/",
29  ]
30
31  deps = [
32    "${utils_path}:libdistributedfiledentry",
33    "${utils_path}:libdistributedfileutils",
34    "//third_party/googletest:gmock_main",
35    "//third_party/googletest:gtest_main",
36  ]
37
38  external_deps = [
39    "c_utils:utils",
40    "hilog:libhilog",
41  ]
42
43  defines = [ "private=public" ]
44  defines += [
45    "LOG_DOMAIN=0xD004307",
46    "LOG_TAG=\"CLOUDSYNC_SA\"",
47  ]
48  use_exceptions = true
49}
50
51ohos_unittest("dfsu_access_token_helper_test") {
52  module_out_path = "filemanagement/dfs_service"
53
54  sources = [
55    "${utils_path}/system/src/dfsu_access_token_helper.cpp",
56    "dfsu_access_token_helper_test.cpp",
57    "reimplement/accesstoken_kit.cpp",
58    "reimplement/accesstoken_kit_mock.cpp",
59    "reimplement/ipc_skeleton.cpp",
60  ]
61
62  include_dirs = [
63    "${distributedfile_path}/test/unittests/cloudsync_sa/system/reimplement",
64    "${communication_ipc_path}/ipc/ipc/native/c/adapter/access_token/include",
65    "${communication_ipc_path}/ipc/ipc/native/src/core/include",
66    "${communication_ipc_path}/ipc/utils/include",
67    "${image_framework_path}/interfaces/innerkits/include",
68    "${image_framework_path}/mock/native/include/log/",
69    "${utils_path}/system/include",
70    "${utils_path}/log/include",
71  ]
72
73  deps = [
74    "${utils_path}:libdistributedfiledentry",
75    "${utils_path}:libdistributedfileutils",
76    "//third_party/googletest:gmock_main",
77    "//third_party/googletest:gtest_main",
78  ]
79
80  external_deps = [
81    "access_token:libaccesstoken_sdk",
82    "access_token:libtokenid_sdk",
83    "c_utils:utils",
84    "c_utils:utilsbase",
85    "hilog:libhilog",
86    "ipc:ipc_core",
87    "preferences:native_preferences",
88  ]
89
90  defines = [ "private=public" ]
91  defines += [
92    "LOG_DOMAIN=0xD004307",
93    "LOG_TAG=\"CLOUDSYNC_SA\"",
94  ]
95  use_exceptions = true
96}
97
98ohos_unittest("dfsu_mount_argument_descriptors_test") {
99  module_out_path = "filemanagement/dfs_service"
100
101  sources = [
102    "${utils_path}/system/src/dfsu_mount_argument_descriptors.cpp",
103    "dfsu_mount_argument_descriptors_test.cpp",
104  ]
105
106  include_dirs = [
107    "${utils_path}/system/include",
108    "${utils_path}/log/include",
109    "//foundation/multimedia/image_framework/mock/native/include/log/",
110  ]
111
112  deps = [
113    "${utils_path}:libdistributedfiledentry",
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  ]
123
124  defines = [ "private=public" ]
125  defines += [
126    "LOG_DOMAIN=0xD004307",
127    "LOG_TAG=\"CLOUDSYNC_SA\"",
128  ]
129  use_exceptions = true
130}
131group("utils_system_src_test") {
132  testonly = true
133  deps = [
134    ":dfsu_access_token_helper_test",
135    ":dfsu_fd_guard_test",
136    ":dfsu_mount_argument_descriptors_test",
137  ]
138}
139