• 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 = "dfs_service/dfs_service_daemon/distributedfiledaemon"
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "${distributedfile_path}/frameworks/native/distributed_file_inner/include",
23    "${services_path}/distributedfiledaemon/include",
24    "${services_path}/distributedfiledaemon/include/ipc",
25  ]
26}
27
28ohos_unittest("mount_manager_test") {
29  branch_protector_ret = "pac_ret"
30  sanitize = {
31    integer_overflow = true
32    cfi = true
33    cfi_cross_dso = true
34    debug = false
35  }
36
37  module_out_path = module_output_path
38
39  sources = [
40    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
41    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
42  ]
43
44  sources += [ "mount_manager_test.cpp" ]
45
46  configs = [
47    ":module_private_config",
48    "${utils_path}:compiler_configs",
49  ]
50
51  deps = [ "${utils_path}:libdistributedfileutils" ]
52
53  external_deps = [
54    "c_utils:utils",
55    "googletest:gmock_main",
56    "googletest:gtest_main",
57    "hilog:libhilog",
58    "json:nlohmann_json_static",
59  ]
60}
61
62ohos_unittest("mount_point_test") {
63  branch_protector_ret = "pac_ret"
64  sanitize = {
65    integer_overflow = true
66    cfi = true
67    cfi_cross_dso = true
68    debug = false
69  }
70
71  module_out_path = module_output_path
72
73  sources = [
74    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
75  ]
76
77  sources += [ "mount_point_test.cpp" ]
78
79  configs = [
80    ":module_private_config",
81    "${utils_path}:compiler_configs",
82  ]
83
84  deps = [ "${utils_path}:libdistributedfileutils" ]
85
86  external_deps = [
87    "c_utils:utils",
88    "googletest:gmock_main",
89    "googletest:gtest_main",
90    "hilog:libhilog",
91    "json:nlohmann_json_static",
92  ]
93
94  defines = [ "private=public" ]
95}
96
97group("unittest") {
98  testonly = true
99  deps = [
100    ":mount_manager_test",
101    ":mount_point_test",
102  ]
103}
104