1# Copyright (c) 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/appmgrservice" 18 19ohos_unittest("cache_process_manager_test") { 20 sanitize = { 21 cfi = true 22 cfi_cross_dso = true 23 debug = false 24 blocklist = "../../cfi_blocklist.txt" 25 } 26 branch_protector_ret = "pac_ret" 27 module_out_path = module_output_path 28 29 include_dirs = [ 30 "${ability_runtime_test_path}/mock/common/include", 31 "${ability_runtime_test_path}/mock/mock_appmgr_service/include", 32 "${ability_runtime_test_path}/mock/mock_sa_call", 33 "${ability_runtime_test_path}/mock/services_appmgr_test/include", 34 ] 35 36 sources = [ 37 "${ability_runtime_services_path}/appmgr/src/cache_process_manager.cpp", 38 "cache_process_manager_test.cpp", 39 ] 40 41 configs = [ "${ability_runtime_services_path}/appmgr:appmgr_config" ] 42 43 deps = [ 44 "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr", 45 "${ability_runtime_native_path}/appkit:appkit_native", 46 "${ability_runtime_path}/utils/server/startup:startup_util", 47 "${ability_runtime_services_path}/appmgr:libappms", 48 "${ability_runtime_services_path}/common:app_util", 49 "${ability_runtime_services_path}/common:res_sched_util", 50 "${ability_runtime_services_path}/common:task_handler_wrap", 51 "//third_party/googletest:gmock_main", 52 "//third_party/googletest:gtest_main", 53 ] 54 55 external_deps = [ 56 "ability_base:configuration", 57 "ability_base:want", 58 "ability_runtime:app_manager", 59 "access_token:libaccesstoken_sdk", 60 "access_token:libnativetoken", 61 "access_token:libtoken_setproc", 62 "appspawn:appspawn_client", 63 "bundle_framework:appexecfwk_base", 64 "bundle_framework:appexecfwk_core", 65 "c_utils:utils", 66 "ffrt:libffrt", 67 "hilog:libhilog", 68 "hisysevent:libhisysevent", 69 "hitrace:hitrace_meter", 70 "init:libbeget_proxy", 71 "init:libbegetutil", 72 "ipc:ipc_core", 73 "napi:ace_napi", 74 "safwk:system_ability_fwk", 75 "samgr:samgr_proxy", 76 ] 77 78 defines = [ "AMS_LOG_TAG = \"AppMgrService\"" ] 79 80 if (ability_command_for_test) { 81 defines += [ "ABILITY_COMMAND_FOR_TEST" ] 82 } 83 84 if (ability_runtime_graphics) { 85 external_deps += [ 86 "window_manager:libwm", 87 "window_manager:libwsutils", 88 ] 89 } 90} 91 92group("unittest") { 93 testonly = true 94 deps = [ ":cache_process_manager_test" ] 95} 96