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 = "filemanagement/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 = [ 31 "${utils_path}:libdistributedfiledentry", 32 "//third_party/googletest:gmock_main", 33 "//third_party/googletest:gtest_main", 34 ] 35 36 external_deps = [ "c_utils:utils" ] 37 38 defines = [ "private=public" ] 39 defines += [ 40 "LOG_DOMAIN=0xD004307", 41 "LOG_TAG=\"CLOUDSYNC_SA\"", 42 ] 43 use_exceptions = true 44} 45 46ohos_unittest("dentry_file_utils_test") { 47 module_out_path = "filemanagement/dfs_service" 48 49 sources = [ "dentry_file_utils_test.cpp" ] 50 51 include_dirs = [ "${utils_path}/dentry/include" ] 52 53 deps = [ 54 "${utils_path}:libdistributedfiledentry", 55 "//third_party/googletest:gmock_main", 56 "//third_party/googletest:gtest_main", 57 ] 58 59 external_deps = [ "c_utils:utils" ] 60 61 defines = [ "private=public" ] 62 defines += [ 63 "LOG_DOMAIN=0xD004307", 64 "LOG_TAG=\"CLOUDSYNC_SA\"", 65 ] 66 use_exceptions = true 67} 68 69ohos_unittest("dentry_meta_file_clouddisk_test") { 70 branch_protector_ret = "pac_ret" 71 sanitize = { 72 integer_overflow = true 73 cfi = true 74 cfi_cross_dso = true 75 debug = false 76 } 77 module_out_path = "filemanagement/dfs_service" 78 79 sources = [ 80 "./mock/base_interface_lib_mock.cpp", 81 "dentry_meta_file_clouddisk_test.cpp", 82 ] 83 84 include_dirs = [ 85 "${distributedfile_path}/test/unittests/cloudsync_sa/dentry/mock/", 86 "${utils_path}/dentry/include", 87 ] 88 89 deps = [ 90 "${utils_path}:libdistributedfiledentry", 91 "${utils_path}:libdistributedfileutils", 92 "//third_party/googletest:gmock_main", 93 "//third_party/googletest:gtest_main", 94 ] 95 96 external_deps = [ "c_utils:utils" ] 97 98 defines = [ "private=public" ] 99 defines += [ 100 "LOG_DOMAIN=0xD004307", 101 "LOG_TAG=\"CLOUDSYNC_SA\"", 102 ] 103 use_exceptions = true 104} 105 106group("cloudsync_sa_dentry_test") { 107 testonly = true 108 deps = [ 109 ":dentry_file_utils_test", 110 ":dentry_meta_file_clouddisk_test", 111 ":dentry_meta_file_test", 112 ] 113} 114