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
19##############################fuzztest##########################################
20ohos_fuzztest("ScanServiceAbilityFuzzTest") {
21  module_out_path = fuzz_test_output_path
22
23  fuzz_config_file = "${print_path}/test/fuzztest/scanserviceability_fuzzer"
24
25  include_dirs = [
26    "mock",
27    "${print_path}/services/scan_service/include",
28    "${print_path}/frameworks/innerkitsimpl/scan_impl/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 = [
40    "${print_path}/frameworks/helper/scan_helper:scan_helper",
41    "${print_path}/frameworks/innerkitsimpl/scan_impl:scan_client",
42    "${print_path}/services/scan_service:scan_service",
43  ]
44
45  external_deps = [
46    "ability_base:base",
47    "ability_base:want",
48    "ability_base:zuri",
49    "ability_runtime:ability_manager",
50    "ability_runtime:abilitykit_native",
51    "access_token:libaccesstoken_sdk",
52    "access_token:libnativetoken",
53    "access_token:libtoken_setproc",
54    "bundle_framework:appexecfwk_base",
55    "bundle_framework:appexecfwk_core",
56    "c_utils:utils",
57    "common_event_service:cesfwk_innerkits",
58    "core_service:tel_core_service_api",
59    "drivers_interface_usb:libusb_proxy_1.0",
60    "eventhandler:libeventhandler",
61    "hilog:libhilog",
62    "hisysevent:libhisysevent",
63    "hitrace:hitrace_meter",
64    "init:libbegetutil",
65    "ipc:ipc_core",
66    "libjpeg-turbo:turbojpeg",
67    "napi:ace_napi",
68    "netmanager_base:net_conn_manager_if",
69    "netmanager_ext:mdns_manager_if",
70    "os_account:os_account_innerkits",
71    "relational_store:native_rdb",
72    "safwk:system_ability_fwk",
73    "samgr:samgr_proxy",
74    "usb_manager:usbsrv_client",
75  ]
76
77  if (security_guard_enabled) {
78    external_deps += [
79      "security_guard:libsg_collect_sdk",
80      "time_service:time_client",
81    ]
82  }
83
84  sources = [
85    "scanserviceability_fuzzer.cpp",
86    "scanserviceability_mock.cpp",
87  ]
88}
89
90###############################################################################
91group("fuzztest") {
92  testonly = true
93  deps = []
94  deps += [
95    # deps file
96    ":ScanServiceAbilityFuzzTest",
97  ]
98}
99###############################################################################
100