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("battery_status_listener_test") { 18 module_out_path = "filemanagement/dfs_service" 19 sources = [ 20 "${distributedfile_path}/services/cloudsyncservice/src/sync_rule/battery_status_listener.cpp", 21 "battery_status_listener_test.cpp", 22 ] 23 24 include_dirs = [ 25 "${services_path}/cloudsyncservice/include", 26 "${services_path}/cloudsyncservice/include/sync_rule", 27 "${innerkits_native_path}/cloudsync_kit_inner", 28 "${distributedfile_path}/adapter/cloud_adapter_example/include", 29 "${services_path}/cloudsyncservice/include/data_sync", 30 "${utils_path}/log/include", 31 "${image_framework_path}/mock/native/include/log", 32 ] 33 34 deps = [ 35 "${services_path}/cloudsyncservice:cloudsync_sa", 36 "${utils_path}:libdistributedfileutils", 37 "//third_party/googletest:gmock_main", 38 "//third_party/googletest:gtest_main", 39 ] 40 41 external_deps = [ 42 "ability_base:want", 43 "common_event_service:cesfwk_innerkits", 44 "hilog:libhilog", 45 "init:libbegetutil", 46 "ipc:ipc_core", 47 "netmanager_base:net_conn_manager_if", 48 "relational_store:native_rdb", 49 "safwk:system_ability_fwk", 50 "samgr:samgr_proxy", 51 ] 52 53 defines = [ "private=public" ] 54 55 use_exceptions = true 56} 57 58ohos_unittest("net_conn_callback_observer_test") { 59 module_out_path = "filemanagement/dfs_service" 60 sources = [ 61 "${distributedfile_path}/services/cloudsyncservice/src/sync_rule/net_conn_callback_observer.cpp", 62 "net_conn_callback_observer_test.cpp", 63 ] 64 65 include_dirs = [ 66 "${services_path}/cloudsyncservice/include", 67 "${services_path}/cloudsyncservice/include/sync_rule", 68 "${utils_path}/log/include", 69 "${image_framework_path}/mock/native/include/log", 70 "${innerkits_native_path}/cloudsync_kit_inner", 71 "${distributedfile_path}/adapter/cloud_adapter_example/include", 72 "${services_path}/cloudsyncservice/include/data_sync", 73 ] 74 75 deps = [ 76 "${services_path}/cloudsyncservice:cloudsync_sa", 77 "${utils_path}:libdistributedfiledentry", 78 "${utils_path}:libdistributedfileutils", 79 "//third_party/googletest:gmock_main", 80 "//third_party/googletest:gtest_main", 81 ] 82 83 external_deps = [ 84 "ability_base:want", 85 "common_event_service:cesfwk_innerkits", 86 "hilog:libhilog", 87 "init:libbegetutil", 88 "ipc:ipc_core", 89 "netmanager_base:net_conn_manager_if", 90 "relational_store:native_rdb", 91 "safwk:system_ability_fwk", 92 "samgr:samgr_proxy", 93 ] 94 95 defines = [ "private=public" ] 96 97 use_exceptions = true 98} 99 100ohos_unittest("network_status_test") { 101 module_out_path = "filemanagement/dfs_service" 102 sources = [ 103 "${distributedfile_path}/services/cloudsyncservice/src/sync_rule/network_status.cpp", 104 "network_status_test.cpp", 105 ] 106 107 include_dirs = [ 108 "${services_path}/cloudsyncservice/include", 109 "${services_path}/cloudsyncservice/include/sync_rule", 110 "${utils_path}/log/include", 111 "${image_framework_path}/mock/native/include/log", 112 "${innerkits_native_path}/cloudsync_kit_inner", 113 "${distributedfile_path}/adapter/cloud_adapter_example/include", 114 "${services_path}/cloudsyncservice/include/data_sync", 115 ] 116 117 deps = [ 118 "${services_path}/cloudsyncservice:cloudsync_sa", 119 "${utils_path}:libdistributedfileutils", 120 "//third_party/googletest:gmock_main", 121 "//third_party/googletest:gtest_main", 122 ] 123 124 external_deps = [ 125 "common_event_service:cesfwk_innerkits", 126 "dfs_service:cloudsync_kit_inner", 127 "hilog:libhilog", 128 "init:libbegetutil", 129 "ipc:ipc_core", 130 "netmanager_base:net_conn_manager_if", 131 "samgr:samgr_proxy", 132 ] 133 134 defines = [ "private=public" ] 135 136 use_exceptions = true 137} 138 139ohos_unittest("cloud_status_test") { 140 module_out_path = "filemanagement/dfs_service" 141 sources = [ 142 "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_container.cpp", 143 "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_database.cpp", 144 "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_error.cpp", 145 "${distributedfile_path}/adapter/cloud_adapter_example/src/dk_record_field.cpp", 146 "${distributedfile_path}/adapter/cloud_adapter_example/src/drive_kit.cpp", 147 "${distributedfile_path}/utils/log/src/dfs_error.cpp", 148 "${services_path}/cloudsyncservice/src/sync_rule/cloud_status.cpp", 149 "cloud_status_test.cpp", 150 ] 151 152 include_dirs = [ 153 "${services_path}/cloudsyncservice/include", 154 "${services_path}/cloudsyncservice/include/sync_rule", 155 "${media_library_path}/frameworks/utils/include", 156 "${distributedfile_path}/adapter/cloud_adapter_example/include", 157 ] 158 159 deps = [ 160 "${services_path}/cloudsyncservice:cloudsync_sa", 161 "${utils_path}:libdistributedfileutils", 162 "//third_party/googletest:gmock_main", 163 "//third_party/googletest:gtest_main", 164 ] 165 166 external_deps = [ "hilog:libhilog" ] 167 168 defines = [ "private=public" ] 169 170 use_exceptions = true 171} 172 173group("cloudsync_sa_sync_rule_test") { 174 testonly = true 175 deps = [ ":cloud_status_test" ] 176} 177