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. 13 14import("//base/account/os_account/os_account.gni") 15import("//build/test.gni") 16 17module_output_path = "os_account/frameworks/test" 18 19config("account_proxy_mock_config_unittest") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "include", 24 "//base/useriam/user_auth_framework/interfaces/inner_api", 25 "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk", 26 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/common/include", 27 "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include", 28 "//foundation/systemabilitymgr/samgr/services/samgr/native/include", 29 "//foundation/systemabilitymgr/samgr/services/samgr/dfx/include", 30 "//foundation/systemabilitymgr/samgr/services/samgr/lsamgr/include", 31 ] 32 33 cflags = [] 34 if (target_cpu == "arm") { 35 cflags += [ "-DBINDER_IPC_32BIT" ] 36 } 37 38 defines = [ 39 "ACCOUNT_LOG_TAG = \"AccountIAMUTestFwk\"", 40 "LOG_DOMAIN = 0xD001B00", 41 ] 42} 43 44ohos_unittest("account_proxy_mock_test") { 45 module_out_path = module_output_path 46 47 sources = [ 48 "account_appaccount_proxy_mock_test.cpp", 49 "account_iam_proxy_mock_test.cpp", 50 "account_ohosaccount_proxy_mock_test.cpp", 51 "account_osaccount_proxy_mock_test.cpp", 52 "mock/iservice_registry.cpp", 53 ] 54 55 configs = [ ":account_proxy_mock_config_unittest" ] 56 57 deps = [ 58 "${account_iam_framework_path}:account_iam_innerkits", 59 "${app_account_innerkits_native_path}:app_account_innerkits", 60 "${common_path}:libaccount_common", 61 "${innerkits_native_path}:libaccountkits", 62 "${os_account_innerkits_native_path}:os_account_innerkits", 63 "//third_party/googletest:gmock_main", 64 "//third_party/googletest:gtest_main", 65 ] 66 67 cflags_cc = [] 68 if (has_pin_auth_part) { 69 cflags_cc += [ "-DHAS_PIN_AUTH_PART" ] 70 deps += [ "//base/useriam/pin_auth/frameworks:pinauth_framework" ] 71 } 72 73 if (has_user_auth_part) { 74 cflags_cc += [ "-DHAS_USER_AUTH_PART" ] 75 deps += [ "//base/useriam/user_auth_framework/frameworks/native/client:userauth_client" ] 76 } 77 78 external_deps = [ 79 "ability_base:want", 80 "hiviewdfx_hilog_native:libhilog", 81 "ipc:ipc_core", 82 "ipc:libdbinder", 83 ] 84} 85 86group("unittest") { 87 testonly = true 88 89 deps = [ ":account_proxy_mock_test" ] 90} 91