• 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("//base/account/os_account/os_account.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17
18module_output_path = "os_account/services/accountmgr"
19
20config("ability_manager_adapter_test_config") {
21  include_dirs = [
22    "${common_path}/log/include",
23    "${common_path}/account_error/include",
24    "${services_path}/accountmgr/include",
25    "${services_path}/accountmgr/include/ability_manager_adapter",
26    "${ability_runtime_path}/interfaces/inner_api/ability_manager/include",
27  ]
28}
29
30ohos_unittest("AbilityManagerAdapterTest") {
31  module_out_path = module_output_path
32  cflags_cc = []
33
34  sources = [ "${services_path}/accountmgr/src/ability_manager_adapter/ability_manager_adapter.cpp" ]
35
36  sources += [ "ability_manager_adapter_test.cpp" ]
37
38  configs = [
39    ":ability_manager_adapter_test_config",
40    "${services_path}/accountmgr/test:accountmgr_test_config",
41  ]
42
43  deps = [
44    "//third_party/googletest:gmock_main",
45    "//third_party/googletest:gtest_main",
46  ]
47  external_deps = [
48    "ability_base:want",
49    "ability_runtime:ability_manager",
50    "c_utils:utils",
51    "hiviewdfx_hilog_native:libhilog",
52    "ipc:ipc_core",
53    "samgr:samgr_proxy",
54  ]
55
56  part_name = "os_account"
57}
58
59ohos_unittest("AbilityManagerAdapterMockTest") {
60  module_out_path = module_output_path
61  cflags_cc = []
62
63  sources = [
64    "${services_path}/accountmgr/src/ability_manager_adapter/ability_manager_adapter.cpp",
65    "//base/account/os_account/services/accountmgr/test/mock/src/mock_service_registry.cpp",
66  ]
67
68  sources += [ "ability_manager_adapter_mock_test.cpp" ]
69
70  configs = [
71    ":ability_manager_adapter_test_config",
72    "${services_path}/accountmgr/test:accountmgr_test_config",
73  ]
74
75  deps = [
76    "//third_party/googletest:gmock_main",
77    "//third_party/googletest:gtest_main",
78  ]
79  external_deps = [
80    "ability_base:want",
81    "ability_runtime:ability_manager",
82    "c_utils:utils",
83    "hiviewdfx_hilog_native:libhilog",
84    "ipc:ipc_core",
85    "samgr:samgr_proxy",
86  ]
87
88  part_name = "os_account"
89}
90
91group("unittest") {
92  testonly = true
93
94  deps = [
95    ":AbilityManagerAdapterMockTest",
96    ":AbilityManagerAdapterTest",
97  ]
98}
99