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