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. 13import("//build/test.gni") 14import("//foundation/filemanagement/dfs_service/distributedfile.gni") 15 16ohos_unittest("cloud_pref_impl_test") { 17 module_out_path = "filemanagement/dfs_service" 18 19 sources = [ 20 "../../../../../distributeddatamgr/preferences/frameworks/native/src/preferences_value.cpp", 21 "../../../utils/preference/src/cloud_pref_impl.cpp", 22 "../../mock/preference_helper_mock.cpp", 23 "./preference/cloud_pref_impl_test.cpp", 24 ] 25 26 include_dirs = [ 27 "${services_path}/cloudsyncservice/include/ipc", 28 "${distributedfile_path}/test/unittests/cloudsync_api/cloudsync_impl/include", 29 "${distributedfile_path}/frameworks/native/cloudsync_kit_inner/include", 30 "${distributedfile_path}/utils/dentry/include", 31 "${distributedfile_path}/utils/log/include", 32 "${distributedfile_path}/utils/preference/include", 33 "../../../../../distributeddatamgr/preferences/interfaces/inner_api/include", 34 "../../../../../distributeddatamgr/preferences/frameworks/native/include", 35 ] 36 37 deps = [ 38 "${utils_path}:libdistributedfileutils", 39 "//third_party/googletest:gmock_main", 40 "//third_party/googletest:gtest_main", 41 ] 42 43 external_deps = [ 44 "dfs_service:cloudsync_kit_inner", 45 "hilog:libhilog", 46 "ipc:ipc_core", 47 ] 48 49 defines = [ "private=public" ] 50 51 use_exceptions = true 52} 53 54ohos_unittest("utils_directory_test") { 55 module_out_path = "filemanagement/dfs_service" 56 57 sources = [ "./system/utils_directory_test.cpp" ] 58 59 include_dirs = [ 60 "${utils_path}/system/include", 61 "${utils_path}/log/include", 62 "//foundation/multimedia/image_framework/mock/native/include/log/", 63 ] 64 65 deps = [ 66 "${utils_path}:libdistributedfiledentry", 67 "${utils_path}:libdistributedfileutils", 68 "//third_party/googletest:gmock_main", 69 "//third_party/googletest:gtest_main", 70 ] 71 72 external_deps = [ 73 "c_utils:utils", 74 "hilog:libhilog", 75 ] 76 77 defines = [ "private=public" ] 78 defines += [ 79 "LOG_DOMAIN=0xD004307", 80 "LOG_TAG=\"CLOUDSYNC_SA\"", 81 ] 82 use_exceptions = true 83} 84 85group("utils_test") { 86 testonly = true 87 88 deps = [ 89 ":cloud_pref_impl_test", 90 ":utils_directory_test", 91 ] 92} 93