1# Copyright (c) 2022-2023 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("../../../../ability_runtime.gni")
17
18config("coverage_flags") {
19  if (ability_runtime_feature_coverage) {
20    cflags = [ "--coverage" ]
21    ldflags = [ "--coverage" ]
22  }
23}
24
25ohos_unittest("ohos_application_test") {
26  module_out_path = "ability_runtime/appkit"
27
28  include_dirs = [
29    "${ability_runtime_path}/mock/services_appmgr_test/include",
30    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
31    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime/context",
32    "${ability_runtime_path}/interfaces/kits/native/ability/native",
33    "${ability_runtime_test_path}/mock/frameworks_kits_runtime_test/",
34    "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include",
35  ]
36
37  sources = [ "ohos_application_test.cpp" ]
38
39  configs = [
40    "${ability_runtime_services_path}/common:common_config",
41    ":coverage_flags",
42  ]
43
44  cflags = []
45
46  if (target_cpu == "arm") {
47    cflags += [ "-DBINDER_IPC_32BIT" ]
48  }
49
50  deps = [
51    "${ability_runtime_native_path}/ability/native:ability_thread",
52    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
53    "${ability_runtime_native_path}/appkit:app_context",
54    "${ability_runtime_native_path}/appkit:appkit_native",
55    "../../../../frameworks/native/ability/native:abilitykit_native",
56    "//third_party/googletest:gmock_main",
57    "//third_party/googletest:gtest_main",
58  ]
59
60  external_deps = [
61    "ability_base:configuration",
62    "ability_base:want",
63    "ability_base:zuri",
64    "ability_runtime:ability_deps_wrapper",
65    "ability_runtime:ability_manager",
66    "ability_runtime:abilitykit_native",
67    "ability_runtime:app_manager",
68    "ability_runtime:runtime",
69    "bundle_framework:appexecfwk_base",
70    "bundle_framework:appexecfwk_core",
71    "c_utils:utils",
72    "common_event_service:cesfwk_innerkits",
73    "eventhandler:libeventhandler",
74    "faultloggerd:libdfx_dumpcatcher",
75    "faultloggerd:libfaultloggerd",
76    "hilog:libhilog",
77    "hisysevent:libhisysevent",
78    "hitrace:hitrace_meter",
79    "init:libbegetutil",
80    "ipc:ipc_core",
81    "napi:ace_napi",
82    "resource_management:global_resmgr",
83    "samgr:samgr_proxy",
84  ]
85}
86
87group("unittest") {
88  testonly = true
89  deps = [ ":ohos_application_test" ]
90}
91