1# Copyright (c) 2022 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/ohos_var.gni") 14import("//build/test.gni") 15import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") 16 17module_output_path = "datamgr_service/distributeddatafwk" 18 19############################################################################### 20config("module_private_config") { 21 visibility = [ ":*" ] 22 23 include_dirs = [ 24 "${device_manager_path}/interfaces/inner_kits/native_cpp/include", 25 "../include/", 26 "../../service/bootstrap/include/", 27 "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", 28 "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", 29 "${kv_store_common_path}", 30 "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/src", 31 "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", 32 "${kv_store_path}/interfaces/innerkits/distributeddata/include", 33 "${data_service_path}/adapter/include", 34 "${data_service_path}/framework/include", 35 "${data_service_path}/service/config/include", 36 "${data_service_path}/app/src", 37 "${data_service_path}/adapter/include/account", 38 "${data_service_path}/app/src/security", 39 "${data_service_path}/service/crypto/include", 40 "${data_service_path}/service/matrix/include", 41 "//third_party/json/single_include", 42 ] 43 ldflags = [ "-Wl,--whole-archive" ] 44 defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] 45} 46 47ohos_unittest("CheckerManagerTest") { 48 module_out_path = module_output_path 49 sources = [ "checker_manager_test.cpp" ] 50 51 configs = [ ":module_private_config" ] 52 53 external_deps = [ 54 "access_token:libaccesstoken_sdk", 55 "access_token:libnativetoken", 56 "c_utils:utils", 57 "hilog:libhilog", 58 "ipc:ipc_core", 59 ] 60 61 deps = [ 62 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", 63 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/checker:distributeddata_checker_static", 64 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", 65 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service:distributeddatasvc", 66 "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", 67 "//third_party/googletest:gtest_main", 68 "//third_party/openssl:libcrypto_shared", 69 ] 70} 71 72ohos_unittest("EventCenterTest") { 73 module_out_path = module_output_path 74 sources = [ "event_center_test.cpp" ] 75 76 configs = [ ":module_private_config" ] 77 78 external_deps = [ 79 "c_utils:utils", 80 "hilog:libhilog", 81 "ipc:ipc_core", 82 ] 83 84 deps = [ 85 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", 86 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", 87 "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", 88 "//third_party/googletest:gtest_main", 89 ] 90} 91 92ohos_unittest("SerializableTest") { 93 module_out_path = module_output_path 94 95 sources = [ "serializable_test.cpp" ] 96 97 configs = [ ":module_private_config" ] 98 99 external_deps = [ 100 "ability_base:base", 101 "ability_base:want", 102 "c_utils:utils", 103 "hilog:libhilog", 104 "ipc:ipc_core", 105 ] 106 107 deps = [ 108 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", 109 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", 110 "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", 111 "//third_party/googletest:gtest_main", 112 "//third_party/openssl:libcrypto_shared", 113 ] 114} 115 116ohos_unittest("AssetLoaderTest") { 117 module_out_path = module_output_path 118 sources = [ "asset_loader_test.cpp" ] 119 configs = [ ":module_private_config" ] 120 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 121} 122 123ohos_unittest("BackupRuleManagerTest") { 124 module_out_path = module_output_path 125 sources = [ "backup_rule_manager_test.cpp" ] 126 configs = [ ":module_private_config" ] 127 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 128} 129 130ohos_unittest("BindEventTest") { 131 module_out_path = module_output_path 132 sources = [ "bind_event_test.cpp" ] 133 configs = [ ":module_private_config" ] 134 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 135} 136 137ohos_unittest("CloudInfoTest") { 138 module_out_path = module_output_path 139 sources = [ "cloud_test.cpp" ] 140 configs = [ ":module_private_config" ] 141 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 142} 143 144ohos_unittest("EventTest") { 145 module_out_path = module_output_path 146 sources = [ "event_test.cpp" ] 147 configs = [ ":module_private_config" ] 148 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 149} 150 151ohos_unittest("GeneralStoreTest") { 152 module_out_path = module_output_path 153 sources = [ "general_store_test.cpp" ] 154 configs = [ ":module_private_config" ] 155 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 156} 157 158ohos_unittest("SubscriptionTest") { 159 module_out_path = module_output_path 160 sources = [ "subscription_test.cpp" ] 161 configs = [ ":module_private_config" ] 162 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 163} 164 165ohos_unittest("FeatureTest") { 166 module_out_path = module_output_path 167 sources = [ "feature_test.cpp" ] 168 configs = [ ":module_private_config" ] 169 deps = [ 170 "${data_service_path}/framework:distributeddatasvcfwk", 171 "${kv_store_path}/interfaces/innerkits/distributeddata:distributeddata_inner", 172 ] 173} 174 175ohos_unittest("MetaDataManagerTest") { 176 module_out_path = module_output_path 177 sources = [ "meta_data_manager_test.cpp" ] 178 configs = [ ":module_private_config" ] 179 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 180} 181 182ohos_unittest("StoreMetaDataLocalTest") { 183 module_out_path = module_output_path 184 sources = [ "store_meta_data_local_test.cpp" ] 185 configs = [ ":module_private_config" ] 186 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 187} 188 189ohos_unittest("ConstantTest") { 190 module_out_path = module_output_path 191 sources = [ "constant_test.cpp" ] 192 configs = [ ":module_private_config" ] 193 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 194} 195 196ohos_unittest("CryptoTest") { 197 module_out_path = module_output_path 198 sources = [ "crypto_test.cpp" ] 199 configs = [ ":module_private_config" ] 200 deps = [ "${data_service_path}/framework:distributeddatasvcfwk" ] 201} 202 203ohos_unittest("ServiceMetaDataTest") { 204 module_out_path = module_output_path 205 206 sources = [ 207 "${data_service_path}/app/src/kvstore_meta_manager.cpp", 208 "meta_data_test.cpp", 209 ] 210 211 configs = [ ":module_private_config" ] 212 213 external_deps = [ 214 "c_utils:utils", 215 "dataclassification:data_transit_mgr", 216 "device_auth:deviceauth_sdk", 217 "hilog:libhilog", 218 "hisysevent:libhisysevent", 219 "hitrace:hitrace_meter", 220 "hitrace:libhitracechain", 221 "ipc:ipc_core", 222 "kv_store:distributeddata_inner", 223 "kv_store:distributeddata_mgr", 224 "kv_store:distributeddb", 225 "safwk:system_ability_fwk", 226 "samgr:samgr_proxy", 227 ] 228 229 deps = [ 230 "${data_service_path}/adapter:distributeddata_adapter", 231 "${data_service_path}/adapter/broadcaster:distributeddata_broadcaster_static", 232 "${data_service_path}/adapter/utils:distributeddata_utils_static", 233 "${data_service_path}/app/src/checker:distributeddata_checker_static", 234 "${data_service_path}/framework:distributeddatasvcfwk", 235 "${data_service_path}/service:distributeddatasvc", 236 "${kv_store_distributeddb_path}:distributeddb", 237 "${kv_store_path}/interfaces/innerkits/distributeddata:distributeddata_inner", 238 "${kv_store_path}/interfaces/innerkits/distributeddatamgr:distributeddata_mgr", 239 "//third_party/googletest:gtest_main", 240 "//third_party/openssl:libcrypto_shared", 241 ] 242} 243 244############################################################################### 245group("unittest") { 246 testonly = true 247 248 deps = [] 249 250 deps += [ 251 ":AssetLoaderTest", 252 ":BackupRuleManagerTest", 253 ":BindEventTest", 254 ":CheckerManagerTest", 255 ":CloudInfoTest", 256 ":ConstantTest", 257 ":CryptoTest", 258 ":EventCenterTest", 259 ":EventTest", 260 ":FeatureTest", 261 ":GeneralStoreTest", 262 ":MetaDataManagerTest", 263 ":SerializableTest", 264 ":ServiceMetaDataTest", 265 ":StoreMetaDataLocalTest", 266 ":SubscriptionTest", 267 ] 268} 269############################################################################### 270