1# Copyright (c) 2021 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/test.gni") 14import("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni") 15module_output_path = "datamgr_service/distributeddatafwk" 16 17############################################################################### 18ohos_unittest("AccountDelegateTest") { 19 module_out_path = module_output_path 20 21 sources = [ 22 "${data_service_path}/framework/account/account_delegate.cpp", 23 "account_delegate_test.cpp", 24 ] 25 include_dirs = [ 26 "//commonlibrary/c_utils/base/include", 27 "${data_service_path}/framework/include/account", 28 "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata/include", 29 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/autils", 30 "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter/include/utils", 31 "//foundation/distributeddatamgr/kv_store/frameworks/common", 32 "${data_service_path}/adapter/account/src", 33 ] 34 cflags = [ 35 "-Dprivate=public", 36 "-Dprotected=public", 37 ] 38 39 deps = [ 40 "../:distributeddata_account_static", 41 "//third_party/googletest:gtest_main", 42 ] 43 44 external_deps = [ 45 "ability_base:base", 46 "ability_base:want", 47 "bundle_framework:appexecfwk_base", 48 "c_utils:utils", 49 "hilog:libhilog", 50 "ipc:ipc_core", 51 "kv_store:distributeddata_inner", 52 "kv_store:distributeddata_mgr", 53 "kv_store:distributeddb", 54 "os_account:libaccountkits", 55 "os_account:os_account_innerkits", 56 ] 57 if (os_account_part_is_enabled) { 58 sources += [ "${data_service_path}/adapter/account/src/account_delegate_normal_impl.cpp" ] 59 cflags_cc = [ "-DOS_ACCOUNT_PART_IS_ENABLED" ] 60 external_deps += [ "access_token:libaccesstoken_sdk" ] 61 } else { 62 sources += [ "${data_service_path}/adapter/account/src/account_delegate_default_impl.cpp" ] 63 } 64 defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] 65} 66 67############################################################################### 68group("unittest") { 69 testonly = true 70 71 deps = [] 72 73 deps += [ ":AccountDelegateTest" ] 74} 75############################################################################### 76