• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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/os_account"
18
19config("os_account_service_config_unittest") {
20  visibility = [ ":*" ]
21
22  include_dirs = []
23
24  cflags = []
25  if (target_cpu == "arm") {
26    cflags += [ "-DBINDER_IPC_32BIT" ]
27  }
28
29  if (os_account_enable_account_short_name) {
30    cflags += [ "-DENABLE_ACCOUNT_SHORT_NAME" ]
31  }
32
33  defines = [
34    "ACCOUNT_LOG_TAG = \"OsAccountUTestFwk\"",
35    "LOG_DOMAIN = 0xD001B00",
36  ]
37}
38
39ohos_unittest("os_account_info_test") {
40  branch_protector_ret = "pac_ret"
41
42  sanitize = {
43    cfi = true
44    cfi_cross_dso = true
45    debug = false
46  }
47
48  module_out_path = module_output_path
49
50  sources = [ "os_account_info_test.cpp" ]
51
52  configs = [ ":os_account_service_config_unittest" ]
53
54  deps = [
55    "${account_test_common}:account_test_common_source_set",
56    "${common_path}:libaccount_common",
57    "${os_account_innerkits_native_path}:os_account_innerkits",
58  ]
59
60  external_deps = [
61    "ability_base:want",
62    "c_utils:utils",
63    "googletest:gmock_main",
64    "googletest:gtest_main",
65    "hilog:libhilog",
66  ]
67  cflags_cc = []
68  if (os_account_enable_multiple_os_accounts || use_clang_coverage) {
69    cflags_cc += [ "-DENABLE_MULTIPLE_OS_ACCOUNTS" ]
70  }
71}
72
73ohos_unittest("os_account_subscribe_info_test") {
74  branch_protector_ret = "pac_ret"
75
76  sanitize = {
77    cfi = true
78    cfi_cross_dso = true
79    debug = false
80  }
81
82  module_out_path = module_output_path
83
84  sources = [ "os_account_subscribe_info_test.cpp" ]
85
86  configs = [ ":os_account_service_config_unittest" ]
87
88  deps = [
89    "${common_path}:libaccount_common",
90    "${os_account_innerkits_native_path}:os_account_innerkits",
91  ]
92
93  external_deps = [
94    "c_utils:utils",
95    "googletest:gmock_main",
96    "googletest:gtest_main",
97    "hilog:libhilog",
98    "ipc:ipc_single",
99  ]
100}
101
102group("unittest") {
103  testonly = true
104
105  deps = [
106    ":os_account_info_test",
107    ":os_account_subscribe_info_test",
108  ]
109}
110