• 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.
13import("//build/test.gni")
14import("//foundation/filemanagement/dfs_service/distributedfile.gni")
15
16module_output_path = "storage_distributed_file_manager/distributedfiledaemon"
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "${distributedfile_path}/frameworks/native/distributed_file_inner/include",
23    "${distributedfile_path}/frameworks/native/distributed_file_inner/include/asset",
24    "${distributedfile_path}/test/mock",
25    "${services_path}/distributedfiledaemon/include",
26    "${services_path}/distributedfiledaemon/include/ipc",
27    "${services_path}/distributedfiledaemon/test/mock/include",
28    "//third_party/json/include",
29  ]
30}
31
32ohos_unittest("asset_callback_manager_test") {
33  branch_protector_ret = "pac_ret"
34  sanitize = {
35    integer_overflow = true
36    cfi = true
37    cfi_cross_dso = true
38    debug = false
39    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
40  }
41
42  module_out_path = module_output_path
43
44  sources = [
45    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
46    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
47    "asset_callback_manager_test.cpp",
48  ]
49
50  configs = [
51    ":module_private_config",
52    "${utils_path}:compiler_configs",
53  ]
54
55  deps = [
56    "${utils_path}:libdistributedfileutils",
57    "//third_party/googletest:gmock_main",
58    "//third_party/googletest:gtest_main",
59  ]
60
61  external_deps = [
62    "c_utils:utils",
63    "dsoftbus:softbus_client",
64    "hilog:libhilog",
65    "ipc:ipc_core",
66    "zlib:shared_libz",
67  ]
68
69  defines = [
70    "private=public",
71    "LOG_TAG=\"distributedfile_daemon\"",
72  ]
73
74  use_exceptions = true
75}
76
77ohos_unittest("asset_recv_callback_proxy_test") {
78  branch_protector_ret = "pac_ret"
79  sanitize = {
80    integer_overflow = true
81    cfi = true
82    cfi_cross_dso = true
83    debug = false
84    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
85  }
86
87  module_out_path = module_output_path
88
89  sources = [
90    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
91    "${distributedfile_path}/test/mock/message_parcel_mock.cpp",
92    "${services_path}/distributedfiledaemon/src/ipc/asset_recv_callback_proxy.cpp",
93    "asset_recv_callback_proxy_test.cpp",
94  ]
95
96  configs = [
97    ":module_private_config",
98    "${utils_path}:compiler_configs",
99  ]
100
101  deps = [
102    "${utils_path}:libdistributedfileutils",
103    "//third_party/googletest:gmock_main",
104    "//third_party/googletest:gtest_main",
105  ]
106
107  external_deps = [
108    "access_token:libaccesstoken_sdk",
109    "c_utils:utils",
110    "hilog:libhilog",
111    "ipc:ipc_core",
112  ]
113}
114
115ohos_unittest("asset_send_callback_proxy_test") {
116  branch_protector_ret = "pac_ret"
117  sanitize = {
118    integer_overflow = true
119    cfi = true
120    cfi_cross_dso = true
121    debug = false
122    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
123  }
124
125  module_out_path = module_output_path
126
127  sources = [
128    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
129    "${distributedfile_path}/test/mock/message_parcel_mock.cpp",
130    "${services_path}/distributedfiledaemon/src/ipc/asset_send_callback_proxy.cpp",
131    "asset_send_callback_proxy_test.cpp",
132  ]
133
134  configs = [
135    ":module_private_config",
136    "${utils_path}:compiler_configs",
137  ]
138
139  deps = [
140    "${utils_path}:libdistributedfileutils",
141    "//third_party/googletest:gmock_main",
142    "//third_party/googletest:gtest_main",
143  ]
144
145  external_deps = [
146    "access_token:libaccesstoken_sdk",
147    "c_utils:utils",
148    "hilog:libhilog",
149    "ipc:ipc_core",
150  ]
151}
152
153group("unittest") {
154  testonly = true
155  deps = [
156    ":asset_callback_manager_test",
157    ":asset_recv_callback_proxy_test",
158    ":asset_send_callback_proxy_test",
159    "daemon:daemon_test",
160    "daemon_execute:daemon_execute_test",
161  ]
162}
163