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
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("AbilityFrameworksNativeJsWorkerFuzzTest") {
23  module_out_path = module_output_path
24
25  fuzz_config_file = "${ability_runtime_test_path}/fuzztest/abilityframeworksnativejsworker_fuzzer"
26  include_dirs = [
27    "${ability_runtime_innerkits_path}/ability_manager/include",
28    "${ability_runtime_innerkits_path}/dataobs_manager/include",
29    "${multimodalinput_path}/interfaces/native/innerkits/event/include",
30    "${ability_runtime_native_path}/runtime",
31    "${ability_runtime_native_path}/runtime/utils/include",
32    "${ability_base_kits_path}/extractortool/include",
33    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
34    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include",
35    "${distributedschedule_path}/samgr/adapter/interfaces/innerkits/include/",
36    "${ability_runtime_innerkits_path}/app_manager/include/appmgr",
37    "${ability_runtime_services_path}/abilitymgr/include",
38    "//third_party/zlib/contrib/minizip",
39    "//third_party/zlib",
40    "//third_party/jsoncpp:jsoncpp",
41  ]
42  cflags = [
43    "-g",
44    "-O0",
45    "-Wno-unused-variable",
46    "-fno-omit-frame-pointer",
47  ]
48  sources = [ "abilityframeworksnativejsworker_fuzzer.cpp" ]
49
50  configs = [
51    "${ability_runtime_innerkits_path}/ability_manager:ability_manager_public_config",
52    "${ability_runtime_services_path}/abilitymgr:abilityms_config",
53  ]
54
55  deps = [
56    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
57    "${ability_runtime_innerkits_path}/ability_manager:ability_start_options",
58    "${ability_runtime_innerkits_path}/ability_manager:mission_info",
59    "${ability_runtime_innerkits_path}/app_manager:app_manager",
60    "${ability_runtime_innerkits_path}/uri_permission:uri_permission_mgr",
61    "${ability_runtime_native_path}/ability/native:abilitykit_native",
62    "${ability_runtime_native_path}/appkit:appkit_manager_helper",
63    "${ability_runtime_path}/utils/server/startup:startup_util",
64    "${ability_runtime_services_path}/abilitymgr:abilityms",
65    "${ability_runtime_services_path}/common:perm_verification",
66    "//third_party/jsoncpp:jsoncpp",
67    "//third_party/libjpeg-turbo:turbojpeg_static",
68  ]
69
70  external_deps = [
71    "ability_base:extractortool",
72    "ability_base:want",
73    "ability_base:zuri",
74    "ability_runtime:ability_deps_wrapper",
75    "ability_runtime:js_environment",
76    "ability_runtime:runtime",
77    "bundle_framework:appexecfwk_base",
78    "bundle_framework:appexecfwk_core",
79    "c_utils:utils",
80    "common_event_service:cesfwk_innerkits",
81    "dsoftbus:softbus_client",
82    "ets_runtime:libark_jsruntime",
83    "eventhandler:libeventhandler",
84    "ffrt:libffrt",
85    "hilog:libhilog",
86    "hitrace:hitrace_meter",
87    "ipc:ipc_core",
88    "napi:ace_napi",
89  ]
90
91  if (background_task_mgr_continuous_task_enable) {
92    external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
93  }
94
95  if (ability_runtime_graphics) {
96    deps += []
97    external_deps += [
98      "i18n:intl_util",
99      "window_manager:libwm",
100    ]
101  }
102}
103
104###############################################################################
105group("fuzztest") {
106  testonly = true
107  deps = []
108  deps += [
109    # deps file
110    ":AbilityFrameworksNativeJsWorkerFuzzTest",
111  ]
112}
113###############################################################################
114