• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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
14#####################hydra-fuzz###################
15import("//build/config/features.gni")
16import("//build/ohos.gni")
17import("//build/test.gni")
18import("//foundation/ability/ability_runtime/ability_runtime.gni")
19module_output_path = "ability_runtime/abilitymgr"
20
21##############################fuzztest##########################################
22ohos_fuzztest("InsightIntentDBCacheFuzzTest") {
23  module_out_path = module_output_path
24
25  fuzz_config_file = "${ability_runtime_test_path}/fuzztest/insightintentdbcache_fuzzer"
26
27  include_dirs = [
28    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
29    "${ability_runtime_innerkits_path}/ability_manager/include/insight_intent",
30    "${ability_runtime_innerkits_path}/wantagent/include",
31    "${ability_runtime_services_path}/abilitymgr/include/utils",
32    "${ability_runtime_services_path}/common/include",
33    "${ability_runtime_test_path}/fuzztest",
34  ]
35
36  cflags = [
37    "-g",
38    "-O0",
39    "-Wno-unused-variable",
40    "-fno-omit-frame-pointer",
41  ]
42
43  sources = [
44    "${ability_runtime_path}/frameworks/native/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp",
45    "${ability_runtime_services_path}/abilitymgr/src/insight_intent/extract_insight_intent_profile.cpp",
46    "${ability_runtime_services_path}/abilitymgr/src/insight_intent/insight_intent_db_cache.cpp",
47    "${ability_runtime_services_path}/abilitymgr/src/insight_intent/insight_intent_execute_manager.cpp",
48    "${ability_runtime_services_path}/abilitymgr/src/insight_intent/insight_intent_profile.cpp",
49    "${ability_runtime_services_path}/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp",
50    "${ability_runtime_services_path}/abilitymgr/src/insight_intent/insight_intent_rdb_storage_mgr.cpp",
51    "${ability_runtime_services_path}/abilitymgr/src/utils/hmsf_utils.cpp",
52    "${ability_runtime_services_path}/common/src/app_utils.cpp",
53    "${ability_runtime_services_path}/common/src/json_utils.cpp",
54    "${ability_runtime_services_path}/common/src/record_cost_time_util.cpp",
55    "insightintentdbcache_fuzzer.cpp",
56  ]
57
58  configs = [
59    "${ability_runtime_services_path}/abilitymgr:abilityms_config",
60    "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config",
61  ]
62  cflags = []
63  if (target_cpu == "arm") {
64    cflags += [ "-DBINDER_IPC_32BIT" ]
65  }
66  deps = [
67    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
68    "${ability_runtime_native_path}/ability/native:abilitykit_native",
69    "${ability_runtime_services_path}/abilitymgr:abilityms",
70    "${ability_runtime_services_path}/common:perm_verification",
71  ]
72
73  external_deps = [
74    "ability_base:want",
75    "ability_base:zuri",
76    "access_token:libaccesstoken_sdk",
77    "c_utils:utils",
78    "common_event_service:cesfwk_innerkits",
79    "config_policy:configpolicy_util",
80    "eventhandler:libeventhandler",
81    "ffrt:libffrt",
82    "hilog:libhilog",
83    "hisysevent:libhisysevent",
84    "hitrace:hitrace_meter",
85    "init:libbeget_proxy",
86    "ipc:ipc_core",
87    "napi:ace_napi",
88    "relational_store:native_appdatafwk",
89    "relational_store:native_dataability",
90    "relational_store:native_rdb",
91    "safwk:system_ability_fwk",
92    "samgr:samgr_proxy",
93    "window_manager:libwsutils",
94    "window_manager:scene_session",
95    "window_manager:session_manager_lite",
96  ]
97
98  if (background_task_mgr_continuous_task_enable) {
99    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
100  }
101}
102
103###############################################################################
104group("fuzztest") {
105  testonly = true
106  deps = []
107  deps += [
108    # deps file
109    ":InsightIntentDBCacheFuzzTest",
110  ]
111}
112###############################################################################
113