• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2025 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")
15import("//foundation/ability/ability_runtime/ability_runtime.gni")
16
17module_output_path = "ability_runtime/ability_runtime/app"
18
19ohos_unittest("AppRecoveryUnitTest") {
20  module_out_path = "ability_runtime/AppRecovery/app"
21  cflags_cc = [ "-DUNITTEST" ]
22  cflags = [ "-DUNITTEST" ]
23  include_dirs = [
24    "./",
25    "mock",
26    "${ability_runtime_path}/interfaces/kits/native/ability/native/ability_runtime",
27    "${ability_runtime_path}/interfaces/kits/native/ability/native/ui_extension_ability",
28    "${ability_runtime_test_path}/mock/services_appmgr_test/include",
29  ]
30
31  # push recovery source file here
32  sources = [ "app_recovery_test.cpp" ]
33
34  if (target_cpu == "arm") {
35    cflags += [ "-DBINDER_IPC_32BIT" ]
36  }
37
38  deps = [
39    "${ability_runtime_innerkits_path}/ability_manager:ability_connect_callback_stub",
40    "${ability_runtime_innerkits_path}/dataobs_manager:dataobs_manager",
41    "${ability_runtime_native_path}/ability/native:abilitykit_native",
42    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
43    "${ability_runtime_native_path}/appkit:app_context",
44    "${ability_runtime_native_path}/appkit:app_context_utils",
45    "${ability_runtime_native_path}/appkit:appkit_delegator",
46    "${ability_runtime_path}/utils/global/freeze:freeze_util",
47    "${ability_runtime_services_path}/common:event_report",
48  ]
49
50  external_deps = [
51    "ability_base:base",
52    "ability_base:configuration",
53    "ability_base:want",
54    "ability_base:zuri",
55    "ability_runtime:ability_context_native",
56    "ability_runtime:ability_deps_wrapper",
57    "ability_runtime:ability_manager",
58    "ability_runtime:napi_base_context",
59    "ability_runtime:runtime",
60    "ability_runtime:wantagent_innerkits",
61    "access_token:libaccesstoken_sdk",
62    "access_token:libtoken_callback_sdk",
63    "bundle_framework:appexecfwk_base",
64    "c_utils:utils",
65    "common_event_service:cesfwk_innerkits",
66    "eventhandler:libeventhandler",
67    "faultloggerd:libdfx_dumpcatcher",
68    "form_fwk:fmskit_native",
69    "form_fwk:form_manager",
70    "hilog:libhilog",
71    "hisysevent:libhisysevent",
72    "hitrace:hitrace_meter",
73    "image_framework:image_native",
74    "ipc:ipc_core",
75    "napi:ace_napi",
76    "runtime_core:ani",
77    "window_manager:libdm",
78    "window_manager:libwm",
79    "window_manager:windowstage_kit",
80  ]
81  if (hichecker_enabled) {
82    external_deps += [ "hichecker:libhichecker" ]
83  }
84}
85
86ohos_unittest("AbilityRecoveryUnitTest") {
87  module_out_path = module_output_path
88  cflags_cc = [ "-DUNITTEST" ]
89  cflags = [ "-DUNITTEST" ]
90  include_dirs = [
91    "./",
92    "./mock",
93    "${ability_runtime_test_path}/mock/services_appmgr_test/include",
94  ]
95
96  # push recovery source file here
97  sources = [ "ability_recovery_test.cpp" ]
98
99  if (target_cpu == "arm") {
100    cflags += [ "-DBINDER_IPC_32BIT" ]
101  }
102
103  deps = [
104    "${ability_runtime_innerkits_path}/dataobs_manager:dataobs_manager",
105    "${ability_runtime_native_path}/ability/native:abilitykit_native",
106    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
107    "${ability_runtime_native_path}/appkit:app_context",
108    "${ability_runtime_native_path}/appkit:app_context_utils",
109    "${ability_runtime_native_path}/appkit:appkit_delegator",
110    "${ability_runtime_services_path}/common:event_report",
111  ]
112
113  external_deps = [
114    "ability_base:base",
115    "ability_base:configuration",
116    "ability_base:want",
117    "ability_base:zuri",
118    "ability_runtime:ability_context_native",
119    "ability_runtime:ability_deps_wrapper",
120    "ability_runtime:ability_manager",
121    "ability_runtime:napi_base_context",
122    "ability_runtime:runtime",
123    "ability_runtime:wantagent_innerkits",
124    "access_token:libaccesstoken_sdk",
125    "access_token:libtoken_callback_sdk",
126    "bundle_framework:appexecfwk_base",
127    "c_utils:utils",
128    "common_event_service:cesfwk_innerkits",
129    "eventhandler:libeventhandler",
130    "faultloggerd:libdfx_dumpcatcher",
131    "form_fwk:fmskit_native",
132    "form_fwk:form_manager",
133    "hilog:libhilog",
134    "hisysevent:libhisysevent",
135    "hitrace:hitrace_meter",
136    "image_framework:image_native",
137    "ipc:ipc_core",
138    "ipc:ipc_napi",
139    "napi:ace_napi",
140    "window_manager:libdm",
141    "window_manager:libwm",
142    "window_manager:windowstage_kit",
143  ]
144  if (hichecker_enabled) {
145    external_deps += [ "hichecker:libhichecker" ]
146  }
147}
148
149group("unittest") {
150  testonly = true
151
152  deps = [
153    ":AbilityRecoveryUnitTest",
154    ":AppRecoveryUnitTest",
155  ]
156}
157