1cb7eb8c9Sopenharmony_ci# Copyright (C) 2024 Huawei Device Co., Ltd.
2cb7eb8c9Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3cb7eb8c9Sopenharmony_ci# you may not use this file except in compliance with the License.
4cb7eb8c9Sopenharmony_ci# You may obtain a copy of the License at
5cb7eb8c9Sopenharmony_ci#
6cb7eb8c9Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7cb7eb8c9Sopenharmony_ci#
8cb7eb8c9Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9cb7eb8c9Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10cb7eb8c9Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11cb7eb8c9Sopenharmony_ci# See the License for the specific language governing permissions and
12cb7eb8c9Sopenharmony_ci# limitations under the License.
13cb7eb8c9Sopenharmony_ciimport("//build/test.gni")
14cb7eb8c9Sopenharmony_ciimport("//foundation/filemanagement/dfs_service/distributedfile.gni")
15cb7eb8c9Sopenharmony_ci
16cb7eb8c9Sopenharmony_cimodule_output_path = "storage_distributed_file_manager/distributedfiledaemon"
17cb7eb8c9Sopenharmony_ci
18cb7eb8c9Sopenharmony_ciconfig("module_private_config") {
19cb7eb8c9Sopenharmony_ci  visibility = [ ":*" ]
20cb7eb8c9Sopenharmony_ci
21cb7eb8c9Sopenharmony_ci  include_dirs = [
22cb7eb8c9Sopenharmony_ci    "${distributedfile_path}/frameworks/native/distributed_file_inner/include",
23cb7eb8c9Sopenharmony_ci    "${services_path}/distributedfiledaemon/include",
24cb7eb8c9Sopenharmony_ci    "${services_path}/distributedfiledaemon/include/ipc",
25cb7eb8c9Sopenharmony_ci    "//third_party/json/include",
26cb7eb8c9Sopenharmony_ci  ]
27cb7eb8c9Sopenharmony_ci}
28cb7eb8c9Sopenharmony_ci
29cb7eb8c9Sopenharmony_ciohos_unittest("mount_manager_test") {
30cb7eb8c9Sopenharmony_ci  branch_protector_ret = "pac_ret"
31cb7eb8c9Sopenharmony_ci  sanitize = {
32cb7eb8c9Sopenharmony_ci    integer_overflow = true
33cb7eb8c9Sopenharmony_ci    cfi = true
34cb7eb8c9Sopenharmony_ci    cfi_cross_dso = true
35cb7eb8c9Sopenharmony_ci    debug = false
36cb7eb8c9Sopenharmony_ci  }
37cb7eb8c9Sopenharmony_ci
38cb7eb8c9Sopenharmony_ci  module_out_path = module_output_path
39cb7eb8c9Sopenharmony_ci
40cb7eb8c9Sopenharmony_ci  sources = [
41cb7eb8c9Sopenharmony_ci    "${services_path}/distributedfiledaemon/src/mountpoint/mount_manager.cpp",
42cb7eb8c9Sopenharmony_ci    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
43cb7eb8c9Sopenharmony_ci  ]
44cb7eb8c9Sopenharmony_ci
45cb7eb8c9Sopenharmony_ci  sources += [ "mount_manager_test.cpp" ]
46cb7eb8c9Sopenharmony_ci
47cb7eb8c9Sopenharmony_ci  configs = [
48cb7eb8c9Sopenharmony_ci    ":module_private_config",
49cb7eb8c9Sopenharmony_ci    "${utils_path}:compiler_configs",
50cb7eb8c9Sopenharmony_ci  ]
51cb7eb8c9Sopenharmony_ci
52cb7eb8c9Sopenharmony_ci  deps = [
53cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfileutils",
54cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gmock_main",
55cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gtest_main",
56cb7eb8c9Sopenharmony_ci  ]
57cb7eb8c9Sopenharmony_ci
58cb7eb8c9Sopenharmony_ci  external_deps = [ "hilog:libhilog" ]
59cb7eb8c9Sopenharmony_ci}
60cb7eb8c9Sopenharmony_ci
61cb7eb8c9Sopenharmony_ciohos_unittest("mount_point_test") {
62cb7eb8c9Sopenharmony_ci  branch_protector_ret = "pac_ret"
63cb7eb8c9Sopenharmony_ci  sanitize = {
64cb7eb8c9Sopenharmony_ci    integer_overflow = true
65cb7eb8c9Sopenharmony_ci    cfi = true
66cb7eb8c9Sopenharmony_ci    cfi_cross_dso = true
67cb7eb8c9Sopenharmony_ci    debug = false
68cb7eb8c9Sopenharmony_ci  }
69cb7eb8c9Sopenharmony_ci
70cb7eb8c9Sopenharmony_ci  module_out_path = module_output_path
71cb7eb8c9Sopenharmony_ci
72cb7eb8c9Sopenharmony_ci  sources = [
73cb7eb8c9Sopenharmony_ci    "${services_path}/distributedfiledaemon/src/mountpoint/mount_point.cpp",
74cb7eb8c9Sopenharmony_ci  ]
75cb7eb8c9Sopenharmony_ci
76cb7eb8c9Sopenharmony_ci  sources += [ "mount_point_test.cpp" ]
77cb7eb8c9Sopenharmony_ci
78cb7eb8c9Sopenharmony_ci  configs = [
79cb7eb8c9Sopenharmony_ci    ":module_private_config",
80cb7eb8c9Sopenharmony_ci    "${utils_path}:compiler_configs",
81cb7eb8c9Sopenharmony_ci  ]
82cb7eb8c9Sopenharmony_ci
83cb7eb8c9Sopenharmony_ci  deps = [
84cb7eb8c9Sopenharmony_ci    "${utils_path}:libdistributedfileutils",
85cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gmock_main",
86cb7eb8c9Sopenharmony_ci    "//third_party/googletest:gtest_main",
87cb7eb8c9Sopenharmony_ci  ]
88cb7eb8c9Sopenharmony_ci
89cb7eb8c9Sopenharmony_ci  external_deps = [ "hilog:libhilog" ]
90cb7eb8c9Sopenharmony_ci
91cb7eb8c9Sopenharmony_ci  defines = [ "private=public" ]
92cb7eb8c9Sopenharmony_ci}
93cb7eb8c9Sopenharmony_ci
94cb7eb8c9Sopenharmony_cigroup("unittest") {
95cb7eb8c9Sopenharmony_ci  testonly = true
96cb7eb8c9Sopenharmony_ci  deps = [
97cb7eb8c9Sopenharmony_ci    ":mount_manager_test",
98cb7eb8c9Sopenharmony_ci    ":mount_point_test",
99cb7eb8c9Sopenharmony_ci  ]
100cb7eb8c9Sopenharmony_ci}
101