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/runtime"
19config("coverage_flags") {
20  if (ability_runtime_feature_coverage) {
21    cflags = [ "--coverage" ]
22    ldflags = [ "--coverage" ]
23  }
24}
25
26ohos_unittest("connect_server_manager_test") {
27  module_out_path = module_output_path
28
29  include_dirs = [ "${ability_runtime_native_path}/runtime" ]
30
31  sources = [ "connect_server_manager_test.cpp" ]
32
33  configs = [
34    ":coverage_flags",
35    "${ability_runtime_services_path}/abilitymgr:abilityms_config",
36    "${ability_runtime_test_path}/mock/services_abilitymgr_test:aafwk_mock_config",
37  ]
38  cflags = []
39  if (target_cpu == "arm") {
40    cflags += [ "-DBINDER_IPC_32BIT" ]
41  }
42
43  deps = [ "//third_party/googletest:gmock_main" ]
44
45  external_deps = [
46    "ability_base:want",
47    "ability_runtime:ability_manager",
48    "ability_runtime:abilitykit_native",
49    "ability_runtime:runtime",
50    "c_utils:utils",
51    "hilog:libhilog",
52    "ipc:ipc_core",
53    "napi:ace_napi",
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 = [ ":connect_server_manager_test" ]
65}
66