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/test.gni")
15import("//foundation/ability/ability_runtime/ability_runtime.gni")
16
17module_output_path = "ability_runtime/app"
18
19ohos_unittest("AppRecoveryUnitTest") {
20  module_out_path = module_output_path
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}/dataobs_manager:dataobs_manager",
40    "${ability_runtime_native_path}/ability/native:abilitykit_native",
41    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
42    "${ability_runtime_native_path}/appkit:app_context",
43    "${ability_runtime_native_path}/appkit:app_context_utils",
44    "${ability_runtime_native_path}/appkit:appkit_delegator",
45    "${ability_runtime_path}/utils/global/freeze:freeze_util",
46    "${ability_runtime_services_path}/common:event_report",
47    "${multimedia_path}/interfaces/innerkits:image_native",
48    "${windowmanager_path}/dm:libdm",
49    "${windowmanager_path}/interfaces/kits/napi/window_runtime:windowstage_kit",
50    "${windowmanager_path}/wm:libwm",
51  ]
52
53  external_deps = [
54    "ability_base:base",
55    "ability_base:configuration",
56    "ability_base:want",
57    "ability_base:zuri",
58    "ability_runtime:ability_context_native",
59    "ability_runtime:ability_deps_wrapper",
60    "ability_runtime:ability_manager",
61    "ability_runtime:napi_base_context",
62    "ability_runtime:runtime",
63    "ability_runtime:wantagent_innerkits",
64    "access_token:libaccesstoken_sdk",
65    "access_token:libtoken_callback_sdk",
66    "bundle_framework:appexecfwk_base",
67    "c_utils:utils",
68    "common_event_service:cesfwk_innerkits",
69    "eventhandler:libeventhandler",
70    "faultloggerd:libdfx_dumpcatcher",
71    "form_fwk:fmskit_native",
72    "form_fwk:form_manager",
73    "hichecker:libhichecker",
74    "hilog:libhilog",
75    "hisysevent:libhisysevent",
76    "hitrace:hitrace_meter",
77    "ipc:ipc_core",
78    "napi:ace_napi",
79  ]
80}
81
82ohos_unittest("AbilityRecoveryUnitTest") {
83  module_out_path = module_output_path
84  cflags_cc = [ "-DUNITTEST" ]
85  cflags = [ "-DUNITTEST" ]
86  include_dirs = [
87    "./",
88    "./mock",
89    "${ability_runtime_test_path}/mock/services_appmgr_test/include",
90  ]
91
92  # push recovery source file here
93  sources = [ "ability_recovery_test.cpp" ]
94
95  if (target_cpu == "arm") {
96    cflags += [ "-DBINDER_IPC_32BIT" ]
97  }
98
99  deps = [
100    "${ability_runtime_innerkits_path}/dataobs_manager:dataobs_manager",
101    "${ability_runtime_native_path}/ability/native:abilitykit_native",
102    "${ability_runtime_native_path}/ability/native:uiabilitykit_native",
103    "${ability_runtime_native_path}/appkit:app_context",
104    "${ability_runtime_native_path}/appkit:app_context_utils",
105    "${ability_runtime_native_path}/appkit:appkit_delegator",
106    "${ability_runtime_services_path}/common:event_report",
107    "${multimedia_path}/interfaces/innerkits:image_native",
108    "${windowmanager_path}/dm:libdm",
109    "${windowmanager_path}/interfaces/kits/napi/window_runtime:windowstage_kit",
110    "${windowmanager_path}/wm:libwm",
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    "hichecker:libhichecker",
134    "hilog:libhilog",
135    "hisysevent:libhisysevent",
136    "hitrace:hitrace_meter",
137    "ipc:ipc_core",
138    "napi:ace_napi",
139  ]
140}
141
142group("unittest") {
143  testonly = true
144
145  deps = [
146    ":AbilityRecoveryUnitTest",
147    ":AppRecoveryUnitTest",
148  ]
149}
150