# Copyright (c) 2021 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/test.gni") import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") module_output_path = "datamgr_service/distributeddataservice" ############################################################################### config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "//foundation/distributeddatamgr/kv_store/frameworks/common", "//foundation/distributeddatamgr/kv_store/frameworks/innerkitsimpl/distributeddatafwk/include", "//foundation/distributeddatamgr/kv_store/frameworks/innerkitsimpl/distributeddatafwk/src", "//foundation/distributeddatamgr/kv_store/frameworks/innerkitsimpl/kvdb/include", "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/permission", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/account", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/dfx", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/broadcaster", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/utils", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/bootstrap/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/config/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/crypto/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/directory/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/permission/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/matrix/include", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/session_manager", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/kvdb", "//foundation/distributeddatamgr/distributedfile/interfaces/kits/js/src/mod_securitylabel", "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include", "//commonlibrary/c_utils/base/include", "//utils/system/safwk/native/include", "../include", "../src", "../src/security", "unittest", "../src/uninstaller", "../src/flowctrl_manager", "../../service/backup/include", "../../../../interfaces/innerkits/distributeddata", "//third_party/json/single_include", ] if (datamgr_service_power) { include_dirs += [ "//base/powermgr/power_manager/interfaces/innerkits/native/include" ] } ldflags = [ "-Wl,--whole-archive" ] defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] } ohos_unittest("KvStoreDataServiceTest") { module_out_path = module_output_path sources = [ "../src/dump_helper.cpp", "../src/feature_stub_impl.cpp", "../src/kvstore_account_observer.cpp", "../src/kvstore_data_service.cpp", "../src/kvstore_device_listener.cpp", "../src/kvstore_meta_manager.cpp", "../src/security/security.cpp", "../src/security/sensitive.cpp", "../src/session_manager/route_head_handler_impl.cpp", "../src/session_manager/session_manager.cpp", "../src/session_manager/upgrade_manager.cpp", "../src/task_manager.cpp", "unittest/kvstore_data_service_test.cpp", ] configs = [ ":module_private_config" ] external_deps = [ "access_token:libaccesstoken_sdk", "c_utils:utils", "dataclassification:data_transit_mgr", "device_auth:deviceauth_sdk", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hitrace:libhitracechain", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (datamgr_service_power) { external_deps += [ "battery_manager:batterysrv_client", "power_manager:powermgr_client", ] } deps = [ "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/broadcaster:distributeddata_broadcaster_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/utils:distributeddata_utils_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/checker:distributeddata_checker_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/flowctrl_manager:distributeddata_flowctrl_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/uninstaller:distributeddata_uninstaller_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service:distributeddatasvc", "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb:distributeddb", "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", "//third_party/googletest:gtest_main", ] part_name = "datamgr_service" } ohos_unittest("SessionManagerTest") { module_out_path = module_output_path sources = [ "../src/kvstore_meta_manager.cpp", "../src/session_manager/route_head_handler_impl.cpp", "../src/session_manager/session_manager.cpp", "../src/session_manager/upgrade_manager.cpp", "unittest/session_manager_test.cpp", ] cflags_cc = [ "-DUT_TEST" ] configs = [ ":module_private_config" ] 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", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (datamgr_service_power) { external_deps += [ "battery_manager:batterysrv_client", "power_manager:powermgr_client", ] } deps = [ "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/broadcaster:distributeddata_broadcaster_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/utils:distributeddata_utils_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/checker:distributeddata_checker_static", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/framework:distributeddatasvcfwk", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service:distributeddatasvc", "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb:distributeddb", "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner", "//third_party/googletest:gtest_main", ] part_name = "datamgr_service" } ohos_unittest("KvStoreFlowCtrlManagerTest") { module_out_path = module_output_path sources = [ "unittest/kvstore_flowctrl_manager_test.cpp" ] configs = [ ":module_private_config" ] external_deps = [ "access_token:libaccesstoken_sdk", "c_utils:utils", "dataclassification:data_transit_mgr", "device_auth:deviceauth_sdk", "hilog:libhilog", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (datamgr_service_power) { external_deps += [ "battery_manager:batterysrv_client", "power_manager:powermgr_client", ] } deps = [ "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter", "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/app/src/flowctrl_manager:distributeddata_flowctrl_static", "//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", ] part_name = "datamgr_service" } ############################################################################### group("unittest") { testonly = true deps = [] deps += [ ":KvStoreDataServiceTest", ":KvStoreFlowCtrlManagerTest", ":SessionManagerTest", ] } ############################################################################### group("moduletest") { testonly = true deps = [ "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", "//third_party/sqlite:sqlite", ] deps += [ #":DistributedDataAccountEventModuleTest", #":DistributedDataFlowCtrlManagerTest", ] } ###############################################################################