# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos_var.gni") import("//build/test.gni") import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") module_output_path = "datamgr_service/distributeddatafwk" ############################################################################### config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include", "${data_service_path}/adapter/include", "${data_service_path}/app/src", "${data_service_path}/framework/include", "${data_service_path}/service/bootstrap/include/", "${data_service_path}/service/backup/include/", "${data_service_path}/service/cloud/", "${data_service_path}/service/config/include/", "${data_service_path}/service/common/", "${data_service_path}/service/crypto/include", "${data_service_path}/service/directory/include/", "${data_service_path}/service/data_share/common", "${data_service_path}/service/data_share/data", "${data_service_path}/service/data_share/dfx", "${data_service_path}/service/data_share/strategies", "${data_service_path}/service/data_share/subscriber_managers", "${data_service_path}/service/data_share", "${data_service_path}/service/matrix/include/", "${data_service_path}/service/kvdb", "${data_service_path}/service/object/", "${data_service_path}/service/permission/include", "${data_service_path}/service/rdb/", "${data_service_path}/service/test/mock", "${data_service_path}/service/waterversion", "${dataobject_path}/interfaces/innerkits", "${dataobject_path}/frameworks/innerkitsimpl/include", "${kv_store_distributeddb_path}/interfaces/include/", "${kv_store_distributeddb_path}/include/", "${relational_store_path}/interfaces/inner_api/cloud_data/include", "${relational_store_path}/interfaces/inner_api/common_type/include", ] defines = [ "TEST_ON_DEVICE", "OPENSSL_SUPPRESS_DEPRECATED", ] } ohos_unittest("CloudDataTest") { sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path sources = [ "${data_service_path}/service/backup/src/backup_manager.cpp", "${data_service_path}/service/bootstrap/src/bootstrap.cpp", "${data_service_path}/service/cloud/cloud_service_impl.cpp", "${data_service_path}/service/cloud/cloud_service_stub.cpp", "${data_service_path}/service/cloud/cloud_types_util.cpp", "${data_service_path}/service/cloud/cloud_value_util.cpp", "${data_service_path}/service/cloud/sync_manager.cpp", "${data_service_path}/service/cloud/sync_strategies/network_sync_strategy.cpp", "${data_service_path}/service/common/common_types_utils.cpp", "${data_service_path}/service/common/value_proxy.cpp", "${data_service_path}/service/common/xcollie.cpp", "${data_service_path}/service/config/src/config_factory.cpp", "${data_service_path}/service/config/src/model/app_id_mapping_config.cpp", "${data_service_path}/service/config/src/model/backup_config.cpp", "${data_service_path}/service/config/src/model/checker_config.cpp", "${data_service_path}/service/config/src/model/cloud_config.cpp", "${data_service_path}/service/config/src/model/component_config.cpp", "${data_service_path}/service/config/src/model/directory_config.cpp", "${data_service_path}/service/config/src/model/global_config.cpp", "${data_service_path}/service/config/src/model/network_config.cpp", "${data_service_path}/service/config/src/model/protocol_config.cpp", "${data_service_path}/service/crypto/src/crypto_manager.cpp", "${data_service_path}/service/matrix/src/device_matrix.cpp", "${data_service_path}/service/matrix/src/matrix_event.cpp", "${data_service_path}/service/rdb/cache_cursor.cpp", "${data_service_path}/service/rdb/rdb_asset_loader.cpp", "${data_service_path}/service/rdb/rdb_cloud.cpp", "${data_service_path}/service/rdb/rdb_cloud_data_translate.cpp", "${data_service_path}/service/rdb/rdb_cursor.cpp", "${data_service_path}/service/rdb/rdb_general_store.cpp", "${data_service_path}/service/rdb/rdb_notifier_proxy.cpp", "${data_service_path}/service/rdb/rdb_query.cpp", "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", "${data_service_path}/service/rdb/rdb_service_impl.cpp", "${data_service_path}/service/rdb/rdb_service_stub.cpp", "${data_service_path}/service/rdb/rdb_watcher.cpp", "${data_service_path}/service/test/mock/checker_mock.cpp", "${data_service_path}/service/waterversion/water_version_manager.cpp", "cloud_data_test.cpp", ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", "c_utils:utils", "hicollie:libhicollie", "hilog:libhilog", "huks:libhukssdk", "ipc:ipc_core", "kv_store:distributeddata_inner", "kv_store:distributeddb", "relational_store:native_rdb", ] deps = [ "../../adapter:distributeddata_adapter", "../../framework:distributeddatasvcfwk", "mock:distributeddata_mock_static", "//third_party/googletest:gtest_main", ] cflags = [ "-fno-access-control", # Ignore Private Member Access Control ] cflags_cc = cflags } ohos_unittest("CloudTest") { module_out_path = module_output_path sources = [ "cloud_test.cpp" ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:base", "ability_base:want", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "kv_store:distributeddata_inner", "kv_store:distributeddb", ] deps = [ "../../adapter:distributeddata_adapter", "../../framework:distributeddatasvcfwk", "../../service:distributeddatasvc", "mock:distributeddata_mock_static", "//third_party/googletest:gtest_main", ] } ohos_unittest("ValueProxyServiceTest") { module_out_path = module_output_path sources = [ "../common/value_proxy.cpp", "value_proxy_test.cpp", ] include_dirs = [ "../../../../../relational_store/interfaces/inner_api/rdb/include", "${relational_store_path}/interfaces/inner_api/common_type/include", ] configs = [ ":module_private_config" ] cflags = [ "-Dprivate=public", "-Dprotected=public", "-Wno-multichar", "-Wno-c99-designator", ] external_deps = [ "ability_base:base", "ability_base:want", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${kv_store_distributeddb_path}:distributeddb", "${relational_store_inner_api_path}:native_rdb_static", "../../adapter:distributeddata_adapter", "../../framework:distributeddatasvcfwk", "../../service:distributeddatasvc", "//third_party/googletest:gtest_main", ] } ohos_unittest("ConfigFactoryTest") { module_out_path = module_output_path sources = [ "config_factory_test.cpp" ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:base", "ability_base:want", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] deps = [ "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service:distributeddatasvc", "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", "//third_party/googletest:gtest_main", "//third_party/openssl:libcrypto_shared", ] } ohos_unittest("DirectoryManagerTest") { module_out_path = module_output_path sources = [ "directory_manager_test.cpp" ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] deps = [ "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service:distributeddatasvc", "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", "//third_party/googletest:gtest_main", ] } ohos_unittest("CryptoManagerTest") { module_out_path = module_output_path sources = [ "crypto_manager_test.cpp" ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] deps = [ "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service:distributeddatasvc", "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", "//third_party/googletest:gtest_main", ] } ohos_unittest("DeviceMatrixTest") { module_out_path = module_output_path sources = [ "device_matrix_test.cpp", "mock/checker_mock.cpp", "mock/db_change_data_mock.cpp", "mock/db_store_mock.cpp", ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb:distributeddb", "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", "//third_party/googletest:gtest_main", ] } ohos_unittest("KVDBGeneralStoreTest") { module_out_path = module_output_path sources = [ "../common/value_proxy.cpp", "../kvdb/kvdb_general_store.cpp", "../rdb/rdb_cloud.cpp", "../rdb/rdb_query.cpp", "../waterversion/water_version_manager.cpp", "kvdb_general_store_test.cpp", "mock/db_change_data_mock.cpp", "mock/db_store_mock.cpp", "mock/general_watcher_mock.cpp", "mock/kv_store_nb_delegate_mock.cpp", ] include_dirs = [ "${data_service_path}/service/common", "${data_service_path}/service/rdb", "${data_service_path}/service/waterversion", "${relational_store_path}/interfaces/innerapi/clouddata/include", "${relational_store_path}/interfaces/inner_api/rdb/include", "${relational_store_path}/interfaces/inner_api/common_type/include", ] configs = [ ":module_private_config" ] cflags = [ "-Dprivate=public", "-Dprotected=public", ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${kv_store_distributeddb_path}:distributeddb", "//third_party/googletest:gtest_main", ] } ohos_unittest("RdbResultSetImplTest") { module_out_path = module_output_path sources = [ "${data_service_path}/service/common/value_proxy.cpp", "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", "mock/cursor_mock.cpp", "rdb_result_set_impl_test.cpp", ] include_dirs = [ "${data_service_path}/service/rdb", "${relational_store_path}/interfaces/inner_api/cloud_data/include", "${relational_store_path}/interfaces/inner_api/rdb/include", "${relational_store_path}/interfaces/inner_api/common_type/include", ] configs = [ ":module_private_config" ] cflags = [ "-Dprivate=public", "-Dprotected=public", "-Wno-multichar", "-Wno-c99-designator", ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/adapter/utils:distributeddata_utils_static", "${data_service_path}/framework:distributeddatasvcfwk", "${kv_store_distributeddb_path}:distributeddb", "${relational_store_inner_api_path}:native_rdb_static", "//third_party/googletest:gtest_main", ] } ohos_unittest("RdbServiceTest") { module_out_path = module_output_path sources = [ "${data_service_path}/service/common/value_proxy.cpp", "${data_service_path}/service/rdb/cache_cursor.cpp", "${data_service_path}/service/rdb/rdb_asset_loader.cpp", "${data_service_path}/service/rdb/rdb_cloud.cpp", "${data_service_path}/service/rdb/rdb_cloud_data_translate.cpp", "${data_service_path}/service/rdb/rdb_cursor.cpp", "${data_service_path}/service/rdb/rdb_general_store.cpp", "${data_service_path}/service/rdb/rdb_notifier_proxy.cpp", "${data_service_path}/service/rdb/rdb_query.cpp", "${data_service_path}/service/rdb/rdb_result_set_impl.cpp", "${data_service_path}/service/rdb/rdb_result_set_stub.cpp", "${data_service_path}/service/rdb/rdb_watcher.cpp", "cache_cursor_test.cpp", "mock/general_watcher_mock.cpp", "rdb_asset_loader_test.cpp", "rdb_cloud_test.cpp", "rdb_cursor_test.cpp", "rdb_general_store_test.cpp", "rdb_query_test.cpp", "rdb_result_set_stub_test.cpp", ] include_dirs = [ "${relational_store_path}/interfaces/inner_api/cloud_data/include", "${relational_store_path}/interfaces/inner_api/rdb/include", "${relational_store_path}/interfaces/inner_api/common_type/include", ] configs = [ ":module_private_config" ] cflags = [ "-Dprivate=public", "-Dprotected=public", "-Wno-multichar", "-Wno-c99-designator", ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "c_utils:utils", "hilog:libhilog", "ipc:ipc_core", "kv_store:distributeddata_inner", "kv_store:distributeddb", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/adapter/utils:distributeddata_utils_static", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${kv_store_distributeddb_path}:distributeddb", "${relational_store_inner_api_path}:native_rdb_static", "//third_party/googletest:gtest_main", ] } ohos_unittest("ObjectAssetLoaderTest") { module_out_path = module_output_path sources = [ "../object/object_asset_loader.cpp", "../object/object_asset_machine.cpp", "../object/object_snapshot.cpp", "object_asset_loader_test.cpp", ] include_dirs = [ "${dataobject_path}/frameworks/innerkitsimpl/include/common", "${dataobject_path}/interfaces/innerkits", "${relational_store_path}/interfaces/inner_api/common_type/include", ] configs = [ ":module_private_config" ] external_deps = [ "c_utils:utils", "dfs_service:cloudsync_asset_kit_inner", "dfs_service:distributed_file_daemon_kit_inner", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "//third_party/googletest:gtest_main", ] cflags = [ "-Dprivate=public", "-Dprotected=public", ] } ohos_unittest("ObjectAssetMachineTest") { module_out_path = module_output_path sources = [ "../object/object_asset_loader.cpp", "../object/object_asset_machine.cpp", "object_asset_machine_test.cpp", ] include_dirs = [ "${dataobject_path}/frameworks/innerkitsimpl/include/common", "${dataobject_path}/interfaces/innerkits", "${relational_store_path}/interfaces/inner_api/common_type/include", ] configs = [ ":module_private_config" ] external_deps = [ "c_utils:utils", "dfs_service:cloudsync_asset_kit_inner", "dfs_service:distributed_file_daemon_kit_inner", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "//third_party/googletest:gtest_main", ] } ohos_unittest("ObjectDmsHandlerTest") { module_out_path = module_output_path sources = [ "../object/object_dms_handler.cpp", "object_dms_handler_test.cpp", ] include_dirs = [] configs = [ ":module_private_config" ] external_deps = [ "c_utils:utils", "dmsfwk:distributed_sdk", "hilog:libhilog", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "//third_party/googletest:gtest_main", ] cflags = [ "-Dprivate=public", "-Dprotected=public", ] } ohos_unittest("ObjectManagerTest") { module_out_path = module_output_path sources = [ "${data_service_path}/service/common/value_proxy.cpp", "../object/object_asset_loader.cpp", "../object/object_asset_machine.cpp", "../object/object_callback_proxy.cpp", "../object/object_data_listener.cpp", "../object/object_manager.cpp", "../object/object_snapshot.cpp", "mock/kv_store_nb_delegate_mock.cpp", "object_manager_test.cpp", ] include_dirs = [ "${dataobject_path}/frameworks/innerkitsimpl/include", "${data_service_path}/service/common", "${dataobject_path}/frameworks/innerkitsimpl/include/common", "${dataobject_path}/interfaces/innerkits", ] configs = [ ":module_private_config" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "c_utils:utils", "dfs_service:cloudsync_asset_kit_inner", "dfs_service:distributed_file_daemon_kit_inner", "dmsfwk:distributed_sdk", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "kv_store:distributeddata_inner", "kv_store:distributeddb", "relational_store:native_rdb", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "//third_party/googletest:gtest_main", ] cflags = [ "-Dprivate=public", "-Dprotected=public", ] } ohos_unittest("ObjectSnapshotTest") { module_out_path = module_output_path sources = [ "../object/object_asset_loader.cpp", "../object/object_asset_machine.cpp", "../object/object_snapshot.cpp", "object_snapshot_test.cpp", ] include_dirs = [ "${dataobject_path}/frameworks/innerkitsimpl/include/common", "${dataobject_path}/interfaces/innerkits", "${relational_store_path}/interfaces/inner_api/common_type/include", ] configs = [ ":module_private_config" ] external_deps = [ "c_utils:utils", "dfs_service:cloudsync_asset_kit_inner", "dfs_service:distributed_file_daemon_kit_inner", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "//third_party/googletest:gtest_main", ] } ohos_unittest("MetaDataTest") { module_out_path = module_output_path sources = [ "${data_service_path}/app/src/kvstore_meta_manager.cpp", "meta_data_test.cpp", ] sanitize = { cfi = true cfi_cross_dso = true debug = false } include_dirs = [ "${data_service_path}/app/src", "${data_service_path}/service/kvdb", "${data_service_path}/adapter/include/account", "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", ] configs = [ ":module_private_config" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "dataclassification:data_transit_mgr", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${kv_store_path}/frameworks/libs/distributeddb:distributeddb", "//third_party/googletest:gtest_main", ] } ohos_unittest("UdmfRunTimeStoreTest") { module_out_path = module_output_path sources = [ "${data_service_path}/app/src/kvstore_meta_manager.cpp", "udmf_run_time_store_test.cpp", ] include_dirs = [ "${data_service_path}/adapter/include/account", "${data_service_path}/adapter/include/communicator", "${data_service_path}/app/src", "${data_service_path}/service/kvdb", "${data_service_path}/service/udmf", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", ] configs = [ ":module_private_config" ] external_deps = [ "ability_base:base", "ability_base:want", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "dataclassification:data_transit_mgr", "dsoftbus:softbus_client", "hilog:libhilog", "hisysevent:libhisysevent", "image_framework:image", "ipc:ipc_core", "kv_store:distributeddata_inner", "udmf:udmf_client", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/adapter/communicator:distributeddata_communicator_static", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${data_service_path}/service/udmf:udmf_server", "${kv_store_path}/frameworks/libs/distributeddb:distributeddb", "//third_party/googletest:gtest_main", "//third_party/openssl:libcrypto_shared", ] } ohos_unittest("WaterVersionManagerTest") { module_out_path = module_output_path sanitize = { cfi = true cfi_cross_dso = true debug = false } sources = [ "${data_service_path}/service/backup/src/backup_manager.cpp", "${data_service_path}/service/bootstrap/src/bootstrap.cpp", "${data_service_path}/service/config/src/config_factory.cpp", "${data_service_path}/service/config/src/model/app_id_mapping_config.cpp", "${data_service_path}/service/config/src/model/backup_config.cpp", "${data_service_path}/service/config/src/model/checker_config.cpp", "${data_service_path}/service/config/src/model/cloud_config.cpp", "${data_service_path}/service/config/src/model/component_config.cpp", "${data_service_path}/service/config/src/model/directory_config.cpp", "${data_service_path}/service/config/src/model/global_config.cpp", "${data_service_path}/service/config/src/model/network_config.cpp", "${data_service_path}/service/config/src/model/protocol_config.cpp", "${data_service_path}/service/waterversion/water_version_manager.cpp", "mock/checker_mock.cpp", "mock/db_change_data_mock.cpp", "mock/db_store_mock.cpp", "water_version_manager_test.cpp", ] include_dirs = [ "${data_service_path}/service/backup/include", "${data_service_path}/service/bootstrap/include", "${data_service_path}/service/cloud", "${data_service_path}/service/common", "${data_service_path}/service/config/include", "${data_service_path}/service/crypto/include", "${data_service_path}/service/dumper/include", "${data_service_path}/service/kvdb", "${data_service_path}/service/matrix/include", "${data_service_path}/service/object", "${data_service_path}/service/permission/include", "${data_service_path}/service/rdb", "${data_service_path}/service/waterversion", "${data_service_path}/adapter/include/communicator", "${data_service_path}/adapter/include", "${data_service_path}/app/src", "${data_service_path}/framework/include", ] configs = [ ":module_private_config" ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", "c_utils:utils", "device_auth:deviceauth_sdk", "device_manager:devicemanagersdk", "dfs_service:cloudsync_asset_kit_inner", "dfs_service:distributed_file_daemon_kit_inner", "dsoftbus:softbus_client", "hilog:libhilog", "ipc:ipc_core", "kv_store:distributeddata_inner", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${kv_store_distributeddb_path}:distributeddb", "//third_party/googletest:gtest_main", "//third_party/openssl:libcrypto_shared", ] } ohos_unittest("DataShareServiceImplTest") { module_out_path = module_output_path include_dirs = [ "${datashare_path}/frameworks/native/common/include", "${datashare_path}/interfaces/inner_api/common/include", "${datashare_path}/interfaces/inner_api/consumer/include", "//third_party/json/single_include", ] sources = [ "${data_service_path}/service/common/xcollie.cpp", "${data_service_path}/service/crypto/src/crypto_manager.cpp", "${data_service_path}/service/data_share/common/app_connect_manager.cpp", "${data_service_path}/service/data_share/common/base64_utils.cpp", "${data_service_path}/service/data_share/common/bundle_mgr_proxy.cpp", "${data_service_path}/service/data_share/common/db_delegate.cpp", "${data_service_path}/service/data_share/common/div_strategy.cpp", "${data_service_path}/service/data_share/common/extension_ability_manager.cpp", "${data_service_path}/service/data_share/common/extension_connect_adaptor.cpp", "${data_service_path}/service/data_share/common/extension_mgr_proxy.cpp", "${data_service_path}/service/data_share/common/kv_delegate.cpp", "${data_service_path}/service/data_share/common/rdb_delegate.cpp", "${data_service_path}/service/data_share/common/scheduler_manager.cpp", "${data_service_path}/service/data_share/common/seq_strategy.cpp", "${data_service_path}/service/data_share/common/uri_utils.cpp", "${data_service_path}/service/data_share/data/published_data.cpp", "${data_service_path}/service/data_share/data/resultset_json_formatter.cpp", "${data_service_path}/service/data_share/data/template_data.cpp", "${data_service_path}/service/data_share/data_provider_config.cpp", "${data_service_path}/service/data_share/data_share_db_config.cpp", "${data_service_path}/service/data_share/data_share_obs_proxy.cpp", "${data_service_path}/service/data_share/data_share_profile_config.cpp", "${data_service_path}/service/data_share/data_share_service_impl.cpp", "${data_service_path}/service/data_share/data_share_service_stub.cpp", "${data_service_path}/service/data_share/data_share_silent_config.cpp", "${data_service_path}/service/data_share/data_share_types_util.cpp", "${data_service_path}/service/data_share/dfx/hiview_adapter.cpp", "${data_service_path}/service/data_share/dfx/hiview_fault_adapter.cpp", "${data_service_path}/service/data_share/strategies/data_proxy/load_config_from_data_proxy_node_strategy.cpp", "${data_service_path}/service/data_share/strategies/data_share/load_config_from_data_share_bundle_info_strategy.cpp", "${data_service_path}/service/data_share/strategies/general/check_is_data_proxy_strategy.cpp", "${data_service_path}/service/data_share/strategies/general/check_is_single_app_strategy.cpp", "${data_service_path}/service/data_share/strategies/general/cross_permission_strategy.cpp", "${data_service_path}/service/data_share/strategies/general/load_config_common_strategy.cpp", "${data_service_path}/service/data_share/strategies/general/load_config_data_info_strategy.cpp", "${data_service_path}/service/data_share/strategies/general/load_config_from_bundle_info_strategy.cpp", "${data_service_path}/service/data_share/strategies/general/permission_strategy.cpp", "${data_service_path}/service/data_share/strategies/get_data_strategy.cpp", "${data_service_path}/service/data_share/strategies/publish_strategy.cpp", "${data_service_path}/service/data_share/strategies/rdb_notify_strategy.cpp", "${data_service_path}/service/data_share/strategies/subscribe_strategy.cpp", "${data_service_path}/service/data_share/strategies/template_strategy.cpp", "${data_service_path}/service/data_share/subscriber_managers/published_data_subscriber_manager.cpp", "${data_service_path}/service/data_share/subscriber_managers/rdb_subscriber_manager.cpp", "${data_service_path}/service/data_share/sys_event_subscriber.cpp", "${data_service_path}/service/kvdb/user_delegate.cpp", "${data_service_path}/service/permission/src/permit_delegate.cpp", "data_share_profile_config_test.cpp", "data_share_service_impl_test.cpp", "data_share_service_stub_test.cpp", "data_share_subscriber_managers_test.cpp", ] configs = [ ":module_private_config" ] cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", "-Wno-multichar", "-Wno-c99-designator", "-Dprivate=public", "-Dprotected=public", ] external_deps = [ "ability_base:base", "ability_base:want", "ability_base:zuri", "ability_runtime:dataobs_manager", "ability_runtime:extension_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "data_share:datashare_common", "device_manager:devicemanagersdk", "hicollie:libhicollie", "hilog:libhilog", "hisysevent:libhisysevent", "huks:libhukssdk", "ipc:ipc_core", "kv_store:distributeddb", "relational_store:native_rdb", "relational_store:rdb_data_share_adapter", "resource_management:global_resmgr", "samgr:samgr_proxy", "time_service:time_client", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/adapter/utils:distributeddata_utils_static", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${data_service_path}/service/data_share:data_share_service", "${kv_store_distributeddb_path}:distributeddb", "//third_party/googletest:gtest_main", ] } ohos_unittest("KvdbServiceImplTest") { module_out_path = module_output_path sources = [ "${data_service_path}/app/src/kvstore_meta_manager.cpp", "${data_service_path}/service/common/value_proxy.cpp", "${data_service_path}/service/kvdb/auth_delegate.cpp", "${data_service_path}/service/kvdb/kvdb_general_store.cpp", "${data_service_path}/service/kvdb/kvdb_notifier_proxy.cpp", "${data_service_path}/service/kvdb/kvdb_watcher.cpp", "${data_service_path}/service/kvdb/query_helper.cpp", "${data_service_path}/service/kvdb/upgrade.cpp", "${data_service_path}/service/kvdb/user_delegate.cpp", "${data_service_path}/service/rdb/rdb_cloud.cpp", "${data_service_path}/service/rdb/rdb_query.cpp", "${data_service_path}/service/waterversion/water_version_manager.cpp", "kvdb_service_impl_test.cpp", "kvdb_service_test.cpp", ] include_dirs = [ "${data_service_path}/app/src", "${data_service_path}/service/kvdb", "${data_service_path}/adapter/include/account", "${kv_store_path}/frameworks/innerkitsimpl/kvdb/include", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatafwk/include", "${kv_store_path}/frameworks/innerkitsimpl/distributeddatasvc/include", ] configs = [ ":module_private_config" ] cflags = [ "-Dprivate=public", "-Dprotected=public", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "dataclassification:data_transit_mgr", "device_auth:deviceauth_sdk", "hilog:libhilog", "hisysevent:libhisysevent", "ipc:ipc_core", "kv_store:distributeddata_inner", "relational_store:native_rdb", ] deps = [ "${data_service_path}/adapter:distributeddata_adapter", "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "${kv_store_path}/frameworks/libs/distributeddb:distributeddb", "//third_party/googletest:gtest_main", ] } ohos_unittest("DumpHelperTest") { module_out_path = module_output_path sources = [ "${data_service_path}/service/dumper/src/dump_helper.cpp", "dump_helper_test.cpp", ] include_dirs = [ "${data_service_path}/service/dumper/include" ] configs = [ ":module_private_config" ] cflags = [ "-Dprivate=public", "-Dprotected=public", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "kv_store:distributeddata_inner", "kv_store:distributeddb", "relational_store:native_rdb", ] deps = [ "${data_service_path}/framework:distributeddatasvcfwk", "${data_service_path}/service:distributeddatasvc", "//third_party/googletest:gtest_main", ] } ############################################################################### group("unittest") { testonly = true deps = [] if (datamgr_service_config) { deps += [ ":ConfigFactoryTest" ] } deps += [ ":CloudDataTest", ":CloudTest", ":CryptoManagerTest", ":DataShareServiceImplTest", ":DeviceMatrixTest", ":DirectoryManagerTest", ":DumpHelperTest", ":KVDBGeneralStoreTest", ":KvdbServiceImplTest", ":MetaDataTest", ":ObjectAssetLoaderTest", ":ObjectAssetMachineTest", ":ObjectDmsHandlerTest", ":ObjectManagerTest", ":ObjectSnapshotTest", ":RdbResultSetImplTest", ":RdbServiceTest", ":UdmfRunTimeStoreTest", ":ValueProxyServiceTest", ":WaterVersionManagerTest", ] } ###############################################################################