# 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/test.gni") import("../../../os_account.gni") module_output_path = "os_account/frameworks/test" config("account_proxy_mock_config_unittest") { visibility = [ ":*" ] include_dirs = [ "include" ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ "ACCOUNT_LOG_TAG = \"AccountIAMUTestFwk\"", "LOG_DOMAIN = 0xD001B00", ] } ohos_unittest("account_proxy_mock_test") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = module_output_path sources = [ "${account_iam_framework_path}/src/account_iam_client.cpp", "${app_account_innerkits_native_path}/src/app_account.cpp", "${app_account_innerkits_native_path}/src/app_account_death_recipient.cpp", "${app_account_innerkits_native_path}/src/app_account_event_listener.cpp", "${app_account_innerkits_native_path}/src/app_account_manager.cpp", "${app_account_innerkits_native_path}/src/app_account_subscriber.cpp", "${innerkits_native_path}/src/ohos_account_kits.cpp", "${innerkits_native_path}/src/ohos_account_kits_impl.cpp", "${os_account_core_path}/src/os_account.cpp", "${os_account_core_path}/src/os_account_death_recipient.cpp", "${os_account_core_path}/src/os_account_event_listener.cpp", "${os_account_core_path}/src/os_account_event_stub.cpp", "${os_account_innerkits_native_path}/src/os_account_manager.cpp", "${os_account_innerkits_native_path}/src/os_account_subscriber.cpp", "account_iam_proxy_mock_test.cpp", "account_ohosaccount_proxy_mock_test.cpp", "mock/iservice_registry.cpp", ] configs = [ ":account_proxy_mock_config_unittest" ] deps = [ "${account_iam_framework_path}:account_iam_innerkits", "${app_account_innerkits_native_path}:app_account_innerkits", "${common_path}:libaccount_common", "${innerkits_native_path}:libaccountkits", "${os_account_innerkits_native_path}:os_account_innerkits", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:want", "access_token:libaccesstoken_sdk", "c_utils:utils", "hilog:libhilog", "ipc:ipc_single", "ipc:libdbinder", ] cflags_cc = [] if (has_pin_auth_part) { cflags_cc += [ "-DHAS_PIN_AUTH_PART" ] external_deps += [ "pin_auth:pinauth_framework" ] } if (has_user_auth_part) { cflags_cc += [ "-DHAS_USER_AUTH_PART" ] external_deps += [ "user_auth_framework:userauth_client" ] } } group("unittest") { testonly = true deps = [ ":account_proxy_mock_test" ] }