• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//build/test.gni")
15import("../../../os_account.gni")
16
17module_output_path = "os_account/frameworks/test"
18
19config("account_proxy_mock_config_unittest") {
20  visibility = [ ":*" ]
21
22  include_dirs = [ "include" ]
23
24  cflags = []
25  if (target_cpu == "arm") {
26    cflags += [ "-DBINDER_IPC_32BIT" ]
27  }
28
29  defines = [
30    "ACCOUNT_LOG_TAG = \"AccountIAMUTestFwk\"",
31    "LOG_DOMAIN = 0xD001B00",
32  ]
33}
34
35ohos_unittest("account_proxy_mock_test") {
36  branch_protector_ret = "pac_ret"
37
38  sanitize = {
39    cfi = true
40    cfi_cross_dso = true
41    debug = false
42  }
43
44  module_out_path = module_output_path
45
46  sources = [
47    "${account_iam_framework_path}/src/account_iam_client.cpp",
48    "${app_account_innerkits_native_path}/src/app_account.cpp",
49    "${app_account_innerkits_native_path}/src/app_account_death_recipient.cpp",
50    "${app_account_innerkits_native_path}/src/app_account_event_listener.cpp",
51    "${app_account_innerkits_native_path}/src/app_account_manager.cpp",
52    "${app_account_innerkits_native_path}/src/app_account_subscriber.cpp",
53    "${innerkits_native_path}/src/ohos_account_kits.cpp",
54    "${innerkits_native_path}/src/ohos_account_kits_impl.cpp",
55    "${os_account_core_path}/src/os_account.cpp",
56    "${os_account_core_path}/src/os_account_death_recipient.cpp",
57    "${os_account_core_path}/src/os_account_event_listener.cpp",
58    "${os_account_core_path}/src/os_account_event_stub.cpp",
59    "${os_account_innerkits_native_path}/src/os_account_manager.cpp",
60    "${os_account_innerkits_native_path}/src/os_account_subscriber.cpp",
61    "account_iam_proxy_mock_test.cpp",
62    "account_ohosaccount_proxy_mock_test.cpp",
63    "mock/iservice_registry.cpp",
64  ]
65
66  configs = [
67    ":account_proxy_mock_config_unittest",
68    "${account_coverage_config_path}:coverage_flags",
69  ]
70
71  deps = [
72    "${account_iam_framework_path}:account_iam_innerkits",
73    "${app_account_innerkits_native_path}:app_account_innerkits",
74    "${common_path}:libaccount_common",
75    "${innerkits_native_path}:libaccountkits",
76    "${os_account_innerkits_native_path}:os_account_innerkits",
77    "//third_party/googletest:gmock_main",
78    "//third_party/googletest:gtest_main",
79  ]
80
81  external_deps = [
82    "ability_base:want",
83    "access_token:libaccesstoken_sdk",
84    "c_utils:utils",
85    "hilog:libhilog",
86    "ipc:ipc_single",
87    "ipc:libdbinder",
88  ]
89
90  cflags_cc = []
91  if (has_pin_auth_part) {
92    cflags_cc += [ "-DHAS_PIN_AUTH_PART" ]
93    external_deps += [ "pin_auth:pinauth_framework" ]
94  }
95
96  if (has_user_auth_part) {
97    cflags_cc += [ "-DHAS_USER_AUTH_PART" ]
98    external_deps += [ "user_auth_framework:userauth_client" ]
99  }
100}
101
102group("unittest") {
103  testonly = true
104
105  deps = [ ":account_proxy_mock_test" ]
106}
107