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