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  }
25  module_out_path = module_output_path
26  cflags_cc = []
27  include_dirs = [
28    "${ability_runtime_innerkits_path}/ability_manager/include/",
29    "${ability_runtime_services_path}/appmgr/include/",
30  ]
31
32  sources = [
33    "${ability_runtime_services_path}/appmgr/src/cache_process_manager.cpp",
34    "cache_process_manager_test.cpp",
35  ]
36
37  configs = [ "${ability_runtime_test_path}/unittest:appmgr_test_config" ]
38  cflags = []
39
40  deps = [
41    "${ability_runtime_innerkits_path}/app_manager:app_manager",
42    "${ability_runtime_innerkits_path}/deps_wrapper:ability_deps_wrapper",
43    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
44    "${ability_runtime_services_path}/appmgr:libappms",
45    "${ability_runtime_services_path}/common:event_report",
46    "${ability_runtime_services_path}/common:perm_verification",
47    "${ability_runtime_services_path}/common:res_sched_util",
48    "${ability_runtime_services_path}/common:task_handler_wrap",
49    "${windowmanager_path}/utils:libwmutil_static",
50    "//third_party/googletest:gmock_main",
51    "//third_party/googletest:gtest_main",
52  ]
53
54  external_deps = [
55    "ability_base:base",
56    "ability_base:configuration",
57    "ability_base:want",
58    "access_token:libaccesstoken_sdk",
59    "appspawn:appspawn_client",
60    "bundle_framework:appexecfwk_base",
61    "bundle_framework:appexecfwk_core",
62    "c_utils:utils",
63    "common_event_service:cesfwk_innerkits",
64    "ffrt:libffrt",
65    "hicollie:libhicollie",
66    "hilog:libhilog",
67    "hisysevent:libhisysevent",
68    "hitrace:hitrace_meter",
69    "init:libbeget_proxy",
70    "init:libbegetutil",
71    "ipc:ipc_core",
72    "kv_store:distributeddata_mgr",
73    "memory_utils:libmeminfo",
74    "safwk:system_ability_fwk",
75    "samgr:samgr_proxy",
76    "window_manager:libwm",
77    "window_manager:libwsutils",
78  ]
79
80  defines = [ "AMS_LOG_TAG = \"AppMgrService\"" ]
81
82  if (ability_command_for_test) {
83    defines += [ "ABILITY_COMMAND_FOR_TEST" ]
84  }
85
86  if (ability_runtime_graphics) {
87    external_deps += [
88      "window_manager:libwm",
89      "window_manager:libwsutils",
90    ]
91  }
92}
93
94group("unittest") {
95  testonly = true
96  deps = [ ":cache_process_manager_test" ]
97}
98