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("//base/print/print_fwk/print.gni")
15import("//build/config/features.gni")
16import("//build/ohos.gni")
17import("//build/test.gni")
18
19ohos_fuzztest("ScanHelperFuzzTest") {
20  module_out_path = fuzz_test_output_path
21
22  fuzz_config_file = "${print_path}/test/fuzztest/scanhelper_fuzzer"
23
24  include_dirs = [
25    "//third_party/node/${print_path}/frameworks/helper/scan_helper/src",
26    "//third_party/curl/include",
27    "${print_path}/frameworks/innerkitsimpl/scan_impl/include",
28    "${print_path}/frameworks/helper/scan_helper/include",
29    "${print_utils_path}/include",
30  ]
31
32  cflags = [
33    "-g",
34    "-O0",
35    "-Wno-unused-variable",
36    "-fno-omit-frame-pointer",
37  ]
38
39  deps = [ "${print_path}/frameworks/helper/scan_helper:scan_helper" ]
40
41  external_deps = [
42    "ability_base:want",
43    "ability_runtime:ability_manager",
44    "ability_runtime:abilitykit_native",
45    "ability_runtime:data_ability_helper",
46    "ability_runtime:napi_base_context",
47    "c_utils:utils",
48    "common_event_service:cesfwk_innerkits",
49    "eventhandler:libeventhandler",
50    "hilog:libhilog",
51    "ipc:ipc_core",
52    "napi:ace_napi",
53    "samgr:samgr_proxy",
54  ]
55
56  if (security_guard_enabled) {
57    external_deps += [
58      "security_guard:libsg_collect_sdk",
59      "time_service:time_client",
60    ]
61  }
62
63  sources = [ "scanhelper_fuzzer.cpp" ]
64}
65
66group("fuzztest") {
67  testonly = true
68  deps = []
69  deps += [
70    # deps file
71    ":ScanHelperFuzzTest",
72  ]
73}
74