• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2023 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
17ohos_unittest("dentry_meta_file_test") {
18  module_out_path = "dfs_service/dfs_service"
19
20  sources = [
21    "./mock/base_interface_lib_mock.cpp",
22    "dentry_meta_file_test.cpp",
23  ]
24
25  include_dirs = [
26    "${distributedfile_path}/test/unittests/cloudsync_sa/dentry/mock/",
27    "${utils_path}/dentry/include",
28  ]
29
30  deps = [ "${utils_path}:libdistributedfiledentry" ]
31
32  external_deps = [
33    "c_utils:utils",
34    "googletest:gmock_main",
35    "googletest:gtest_main",
36  ]
37
38  defines = [ "private=public" ]
39  defines += [
40    "LOG_DOMAIN=0xD004307",
41    "LOG_TAG=\"CLOUDSYNC_SA\"",
42  ]
43  if (dfs_service_feature_enable_cloud_adapter) {
44    defines += [ "CLOUD_ADAPTER_ENABLED" ]
45  }
46  use_exceptions = true
47}
48
49ohos_unittest("dentry_file_utils_test") {
50  module_out_path = "dfs_service/dfs_service"
51
52  sources = [ "dentry_file_utils_test.cpp" ]
53
54  include_dirs = [ "${utils_path}/dentry/include" ]
55
56  deps = [ "${utils_path}:libdistributedfiledentry" ]
57
58  external_deps = [
59    "c_utils:utils",
60    "googletest:gmock_main",
61    "googletest:gtest_main",
62  ]
63
64  defines = [ "private=public" ]
65  defines += [
66    "LOG_DOMAIN=0xD004307",
67    "LOG_TAG=\"CLOUDSYNC_SA\"",
68  ]
69  use_exceptions = true
70}
71
72ohos_unittest("dentry_meta_file_clouddisk_test") {
73  branch_protector_ret = "pac_ret"
74  sanitize = {
75    integer_overflow = true
76    cfi = true
77    cfi_cross_dso = true
78    debug = false
79  }
80  module_out_path = "dfs_service/dfs_service"
81
82  sources = [
83    "./mock/base_interface_lib_mock.cpp",
84    "dentry_meta_file_clouddisk_test.cpp",
85  ]
86
87  include_dirs = [
88    "${distributedfile_path}/test/unittests/cloudsync_sa/dentry/mock/",
89    "${utils_path}/dentry/include",
90  ]
91
92  deps = [
93    "${utils_path}:libdistributedfiledentry",
94    "${utils_path}:libdistributedfileutils",
95  ]
96
97  external_deps = [
98    "c_utils:utils",
99    "googletest:gmock_main",
100    "googletest:gtest_main",
101  ]
102
103  defines = [ "private=public" ]
104  defines += [
105    "LOG_DOMAIN=0xD004307",
106    "LOG_TAG=\"CLOUDSYNC_SA\"",
107  ]
108  if (dfs_service_feature_enable_cloud_adapter) {
109    defines += [ "CLOUD_ADAPTER_ENABLED" ]
110  }
111  use_exceptions = true
112}
113
114group("cloudsync_sa_dentry_test") {
115  testonly = true
116  deps = [
117    ":dentry_file_utils_test",
118    ":dentry_meta_file_clouddisk_test",
119    ":dentry_meta_file_test",
120  ]
121}
122