• 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
17module_output_path = "storage_distributed_file_manager/distributedfiledaemon"
18
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "${distributedfile_path}/frameworks/native/distributed_file_inner/include",
24    "${distributedfile_path}/test",
25    "${services_path}/distributedfiledaemon/include",
26    "${services_path}/distributedfiledaemon/include/ipc",
27    "//third_party/json/include",
28  ]
29}
30
31ohos_unittest("daemon_test") {
32  branch_protector_ret = "pac_ret"
33  sanitize = {
34    integer_overflow = true
35    cfi = true
36    cfi_cross_dso = true
37    debug = false
38    blocklist = "${distributedfile_path}/cfi_blocklist.txt"
39  }
40
41  module_out_path = module_output_path
42
43  include_dirs = [
44    "${distributedfile_path}/services/distributedfiledaemon/include/network/softbus",
45    "${distributedfile_path}/services/distributedfiledaemon/test/mock/include",
46  ]
47
48  sources = [
49    "${distributedfile_path}/frameworks/native/distributed_file_inner/src/asset/asset_obj.cpp",
50    "${services_path}/distributedfiledaemon/src/connect_count/connect_count.cpp",
51    "${services_path}/distributedfiledaemon/src/ipc/asset_callback_manager.cpp",
52    "${services_path}/distributedfiledaemon/src/ipc/daemon.cpp",
53    "${services_path}/distributedfiledaemon/src/ipc/daemon_eventhandler.cpp",
54    "${services_path}/distributedfiledaemon/src/ipc/daemon_execute.cpp",
55    "${services_path}/distributedfiledaemon/src/ipc/daemon_stub.cpp",
56    "${services_path}/distributedfiledaemon/src/ipc/file_trans_listener_proxy.cpp",
57    "${services_path}/distributedfiledaemon/src/ipc/trans_mananger.cpp",
58    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
59    "${services_path}/distributedfiledaemon/src/multiuser/os_account_observer.cpp",
60    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_asset_send_listener.cpp",
61    "${services_path}/distributedfiledaemon/src/network/softbus/softbus_session_pool.cpp",
62    "${services_path}/distributedfiledaemon/test/mock/all_connect_manager_mock.cpp",
63    "${services_path}/distributedfiledaemon/test/mock/connection_detector_mock.cpp",
64    "${services_path}/distributedfiledaemon/test/mock/device_manager_agent_mock.cpp",
65    "${services_path}/distributedfiledaemon/test/mock/softbus_handler_asset_mock.cpp",
66    "${services_path}/distributedfiledaemon/test/mock/softbus_handler_mock.cpp",
67    "${services_path}/distributedfiledaemon/test/mock/softbus_session_listener_mock.cpp",
68    "${services_path}/distributedfiledaemon/test/mock/system_ability_manager_client_mock.cpp",
69    "daemon_test.cpp",
70  ]
71
72  configs = [
73    ":module_private_config",
74    "${utils_path}:compiler_configs",
75  ]
76
77  deps = [
78    "${utils_path}:libdistributedfileutils",
79    "//third_party/googletest:gmock_main",
80    "//third_party/googletest:gtest_main",
81  ]
82
83  external_deps = [
84    "ability_base:zuri",
85    "access_token:libaccesstoken_sdk",
86    "app_file_service:sandbox_helper_native",
87    "c_utils:utils",
88    "common_event_service:cesfwk_innerkits",
89    "device_auth:deviceauth_sdk",
90    "device_manager:devicemanagersdk",
91    "dsoftbus:softbus_client",
92    "eventhandler:libeventhandler",
93    "hilog:libhilog",
94    "hisysevent:libhisysevent",
95    "ipc:ipc_single",
96    "os_account:os_account_innerkits",
97    "safwk:system_ability_fwk",
98    "storage_service:storage_manager_sa_proxy",
99    "zlib:shared_libz",
100  ]
101
102  defines = [
103    "private=public",
104    "LOG_TAG=\"distributedfile_daemon\"",
105  ]
106}
107
108group("unittest") {
109  testonly = true
110  deps = [ ":daemon_test" ]
111}
112