• 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")
15
16module_output_path = "safwk/safwk"
17
18ohos_unittest("LocalAbilityManagerTest") {
19  module_out_path = module_output_path
20  resource_config_file =
21      "//foundation/systemabilitymgr/safwk/test/resource/ohos_test.xml"
22
23  include_dirs = [
24    "//foundation/systemabilitymgr/safwk/services/safwk/include",
25    "//foundation/systemabilitymgr/samgr/services/lsamgr/include",
26    "//foundation/systemabilitymgr/safwk/test/services/safwk/unittest/include",
27  ]
28
29  sources = [
30    "./local_ability_manager_test.cpp",
31    "./mock_sa_realize.cpp",
32  ]
33
34  configs =
35      [ "//foundation/systemabilitymgr/safwk/test/resource:coverage_flags" ]
36
37  deps = [
38    "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk",
39    "//foundation/systemabilitymgr/safwk/test/mock/common/audio_ability:test_audio_ability",
40    "//foundation/systemabilitymgr/safwk/test/mock/common/ondemand_ability:test_ondemand_ability",
41    "//third_party/googletest:gtest_main",
42  ]
43
44  if (target_cpu == "arm") {
45    cflags = [ "-DBINDER_IPC_32BIT" ]
46  }
47
48  external_deps = [
49    "c_utils:utils",
50    "hiviewdfx_hilog_native:libhilog",
51    "ipc:ipc_core",
52    "samgr:samgr_common",
53    "samgr:samgr_proxy",
54  ]
55}
56
57ohos_unittest("SystemAbilityTest") {
58  module_out_path = module_output_path
59
60  resource_config_file =
61      "//foundation/systemabilitymgr/safwk/test/resource/ohos_test.xml"
62
63  include_dirs = [
64    "//foundation/systemabilitymgr/safwk/services/safwk/include",
65    "//foundation/systemabilitymgr/safwk/test/services/safwk/unittest/include",
66    "//foundation/systemabilitymgr/samgr/services/lsamgr/include",
67  ]
68
69  sources = [
70    "./mock_sa_realize.cpp",
71    "./sa_mock_permission.cpp",
72    "./system_ability_test.cpp",
73  ]
74
75  configs =
76      [ "//foundation/systemabilitymgr/safwk/test/resource:coverage_flags" ]
77
78  deps = [
79    "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk",
80    "//third_party/googletest:gtest_main",
81  ]
82
83  if (target_cpu == "arm") {
84    cflags = [ "-DBINDER_IPC_32BIT" ]
85  }
86
87  external_deps = [
88    "access_token:libaccesstoken_sdk",
89    "access_token:libnativetoken",
90    "access_token:libtoken_setproc",
91    "c_utils:utils",
92    "hiviewdfx_hilog_native:libhilog",
93    "ipc:ipc_core",
94    "samgr:samgr_common",
95  ]
96}
97
98group("unittest") {
99  testonly = true
100  deps = [
101    ":LocalAbilityManagerTest",
102    ":SystemAbilityTest",
103  ]
104}
105