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