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