1# Copyright (c) 2024-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/abilitymgr" 18 19ohos_unittest("keep_alive_process_manager_test") { 20 module_out_path = module_output_path 21 22 include_dirs = [ 23 "mock/include", 24 "${ability_runtime_services_path}/abilitymgr/include", 25 "${ability_runtime_services_path}/abilitymgr/include/keep_alive", 26 "${ability_runtime_services_path}/abilitymgr/include/utils", 27 ] 28 29 sources = [ 30 "${ability_runtime_services_path}/abilitymgr/src/keep_alive/keep_alive_info.cpp", 31 "${ability_runtime_services_path}/abilitymgr/src/keep_alive/keep_alive_process_manager.cpp", 32 "${ability_runtime_services_path}/abilitymgr/src/process_options.cpp", 33 "keep_alive_process_manager_test.cpp", 34 "mock/src/ability_keep_alive_service.cpp", 35 "mock/src/ability_manager_service.cpp", 36 "mock/src/app_mgr_client.cpp", 37 "mock/src/app_scheduler.cpp", 38 "mock/src/bundle_mgr_helper.cpp", 39 "mock/src/main_element_utils.cpp", 40 "mock/src/mock_my_flag.cpp", 41 "mock/src/parameters.cpp", 42 "mock/src/permission_verification.cpp", 43 ] 44 45 configs = [ "${ability_runtime_services_path}/abilitymgr:abilityms_config" ] 46 cflags = [] 47 if (target_cpu == "arm") { 48 cflags += [ "-DBINDER_IPC_32BIT" ] 49 } 50 deps = [ "${ability_runtime_services_path}/abilitymgr:abilityms" ] 51 52 external_deps = [ 53 "ability_base:base", 54 "ability_base:want", 55 "bundle_framework:appexecfwk_base", 56 "bundle_framework:appexecfwk_core", 57 "c_utils:utils", 58 "ffrt:libffrt", 59 "googletest:gtest_main", 60 "hilog:libhilog", 61 "hitrace:hitrace_meter", 62 "init:libbeget_proxy", 63 "ipc:ipc_core", 64 ] 65 66 if (ability_runtime_child_process) { 67 defines = [ "SUPPORT_CHILD_PROCESS" ] 68 } 69} 70 71group("unittest") { 72 testonly = true 73 74 deps = [ ":keep_alive_process_manager_test" ] 75} 76