• 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/ohos.gni")
15import("//build/test.gni")
16import("//foundation/ability/ability_runtime/ability_runtime.gni")
17
18module_output_path = "ability_runtime/appkit"
19config("coverage_flags") {
20  if (ability_runtime_feature_coverage) {
21    cflags = [ "--coverage" ]
22    ldflags = [ "--coverage" ]
23  }
24}
25
26ohos_unittest("ability_manager_test") {
27  module_out_path = module_output_path
28
29  include_dirs = []
30
31  sources = [
32    "${ability_runtime_native_path}/appkit/app/ability_manager.cpp",
33    "ability_manager_test.cpp",
34  ]
35
36  configs = [
37    ":coverage_flags",
38    "${ability_runtime_services_path}/abilitymgr:abilityms_config",
39    "${ability_runtime_test_path}/mock/services_abilitymgr_test:aafwk_mock_config",
40  ]
41  cflags = []
42  if (target_cpu == "arm") {
43    cflags += [ "-DBINDER_IPC_32BIT" ]
44  }
45  deps = [ "//third_party/googletest:gmock_main" ]
46
47  external_deps = [
48    "ability_base:want",
49    "ability_runtime:ability_manager",
50    "ability_runtime:abilitykit_native",
51    "c_utils:utils",
52    "hiviewdfx_hilog_native:libhilog",
53    "ipc:ipc_core",
54  ]
55
56  if (background_task_mgr_continuous_task_enable) {
57    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
58  }
59}
60
61group("unittest") {
62  testonly = true
63
64  deps = [ ":ability_manager_test" ]
65}
66