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 "hilog:libhilog", 74 "hisysevent:libhisysevent", 75 "hitrace:hitrace_meter", 76 "ipc:ipc_core", 77 "napi:ace_napi", 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 "${multimedia_path}/interfaces/innerkits:image_native", 110 "${windowmanager_path}/dm:libdm", 111 "${windowmanager_path}/interfaces/kits/napi/window_runtime:windowstage_kit", 112 "${windowmanager_path}/wm:libwm", 113 ] 114 115 external_deps = [ 116 "ability_base:base", 117 "ability_base:configuration", 118 "ability_base:want", 119 "ability_base:zuri", 120 "ability_runtime:ability_context_native", 121 "ability_runtime:ability_deps_wrapper", 122 "ability_runtime:ability_manager", 123 "ability_runtime:napi_base_context", 124 "ability_runtime:runtime", 125 "ability_runtime:wantagent_innerkits", 126 "access_token:libaccesstoken_sdk", 127 "access_token:libtoken_callback_sdk", 128 "bundle_framework:appexecfwk_base", 129 "c_utils:utils", 130 "common_event_service:cesfwk_innerkits", 131 "eventhandler:libeventhandler", 132 "faultloggerd:libdfx_dumpcatcher", 133 "form_fwk:fmskit_native", 134 "form_fwk:form_manager", 135 "hilog:libhilog", 136 "hisysevent:libhisysevent", 137 "hitrace:hitrace_meter", 138 "ipc:ipc_core", 139 "napi:ace_napi", 140 ] 141 if (hichecker_enabled) { 142 external_deps += [ "hichecker:libhichecker" ] 143 } 144} 145 146group("unittest") { 147 testonly = true 148 149 deps = [ 150 ":AbilityRecoveryUnitTest", 151 ":AppRecoveryUnitTest", 152 ] 153} 154