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("dfsu_fd_guard_test") { 18 module_out_path = "dfs_service/dfs_service" 19 20 sources = [ 21 "${utils_path}/system/src/dfsu_fd_guard.cpp", 22 "dfsu_fd_guard_test.cpp", 23 ] 24 25 include_dirs = [ 26 "${utils_path}/system/include", 27 "${utils_path}/log/include", 28 ] 29 30 deps = [ 31 "${utils_path}:libdistributedfiledentry", 32 "${utils_path}:libdistributedfileutils", 33 ] 34 35 external_deps = [ 36 "c_utils:utils", 37 "googletest:gmock_main", 38 "googletest:gtest_main", 39 "hilog:libhilog", 40 "image_framework:image_native", 41 ] 42 43 defines = [ "private=public" ] 44 defines += [ 45 "LOG_DOMAIN=0xD004307", 46 "LOG_TAG=\"CLOUDSYNC_SA\"", 47 ] 48 use_exceptions = true 49} 50 51ohos_unittest("dfsu_access_token_helper_test") { 52 module_out_path = "dfs_service/dfs_service" 53 54 sources = [ 55 "${utils_path}/system/src/dfsu_access_token_helper.cpp", 56 "dfsu_access_token_helper_test.cpp", 57 "reimplement/accesstoken_kit.cpp", 58 "reimplement/accesstoken_kit_mock.cpp", 59 "reimplement/ipc_skeleton.cpp", 60 ] 61 62 include_dirs = [ 63 "${distributedfile_path}/test/unittests/cloudsync_sa/system/reimplement", 64 "${utils_path}/system/include", 65 "${utils_path}/log/include", 66 ] 67 68 deps = [ 69 "${utils_path}:libdistributedfiledentry", 70 "${utils_path}:libdistributedfileutils", 71 ] 72 73 external_deps = [ 74 "ability_base:want", 75 "ability_base:zuri", 76 "ability_runtime:uri_permission_mgr", 77 "access_token:libaccesstoken_sdk", 78 "access_token:libtokenid_sdk", 79 "c_utils:utils", 80 "googletest:gmock_main", 81 "googletest:gtest_main", 82 "hilog:libhilog", 83 "hisysevent:libhisysevent", 84 "image_framework:image_native", 85 "ipc:ipc_core", 86 "os_account:os_account_innerkits", 87 "preferences:native_preferences", 88 ] 89 90 defines = [ "private=public" ] 91 defines += [ 92 "LOG_DOMAIN=0xD004307", 93 "LOG_TAG=\"CLOUDSYNC_SA\"", 94 ] 95 use_exceptions = true 96} 97 98ohos_unittest("dfsu_mount_argument_descriptors_test") { 99 module_out_path = "dfs_service/dfs_service" 100 101 sources = [ 102 "${utils_path}/system/src/dfsu_mount_argument_descriptors.cpp", 103 "dfsu_mount_argument_descriptors_test.cpp", 104 ] 105 106 include_dirs = [ 107 "${utils_path}/system/include", 108 "${utils_path}/log/include", 109 ] 110 111 deps = [ 112 "${utils_path}:libdistributedfiledentry", 113 "${utils_path}:libdistributedfileutils", 114 ] 115 116 external_deps = [ 117 "c_utils:utils", 118 "googletest:gmock_main", 119 "googletest:gtest_main", 120 "hilog:libhilog", 121 "image_framework:image_native", 122 ] 123 124 defines = [ "private=public" ] 125 defines += [ 126 "LOG_DOMAIN=0xD004307", 127 "LOG_TAG=\"CLOUDSYNC_SA\"", 128 ] 129 use_exceptions = true 130} 131group("utils_system_src_test") { 132 testonly = true 133 deps = [ 134 ":dfsu_access_token_helper_test", 135 ":dfsu_fd_guard_test", 136 ":dfsu_mount_argument_descriptors_test", 137 ] 138} 139