1# Copyright (c) 2022-2023 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/config/features.gni")
15import("//build/test.gni")
16import("./../../../multimedia_camera_framework.gni")
17
18ohos_fuzztest("StreamCaptureFuzzTest") {
19  module_out_path = "camera_framework/camera_framework"
20  fuzz_config_file = "../streamcapture_fuzzer"
21
22  include_dirs = [
23    "${driver_disply_path}/interfaces/include",
24    "${graphic_surface_path}/surface/include",
25    "${multimedia_camera_framework_path}/services/camera_service/include",
26    "${multimedia_camera_framework_path}/services/camera_service/binder/base/include",
27    "${multimedia_camera_framework_path}/services/camera_service/binder/client/include",
28    "${multimedia_camera_framework_path}/services/camera_service/binder/server/include",
29    "${multimedia_camera_framework_path}/interfaces/inner_api/native/camera/include",
30    "${window_manager_path}/interfaces/innerkits/dm",
31    "${base_security_path}/interfaces/innerkits/accesstoken/include",
32    "${driver_peripheral_path}/interfaces/include",
33    "${driver_peripheral_path}/interfaces/hdi_ipc",
34    "${driver_peripheral_path}/interfaces/hdi_ipc/utils/include",
35    "${driver_peripheral_path}/interfaces/hdi_ipc/callback/device/include",
36    "${driver_peripheral_path}/interfaces/hdi_ipc/callback/operator/include",
37    "${driver_peripheral_path}/interfaces/hdi_ipc/callback/host/include",
38    "${base_security_path}/interfaces/innerkits/token_setproc/include",
39    "${system_safwk_path}/native/include",
40    "${driver_disply_path}/interfaces/include",
41  ]
42
43  cflags = [
44    "-g",
45    "-O0",
46    "-Wno-unused-variable",
47    "-fno-omit-frame-pointer",
48  ]
49
50  sources = [ "stream_capture_fuzzer.cpp" ]
51
52  deps = [ "../../../services/camera_service:camera_service" ]
53  external_deps = [
54    "ability_base:want",
55    "access_token:libaccesstoken_sdk",
56    "access_token:libnativetoken",
57    "access_token:libprivacy_sdk",
58    "access_token:libtoken_setproc",
59    "bundle_framework:appexecfwk_base",
60    "bundle_framework:appexecfwk_core",
61    "c_utils:utils",
62    "drivers_interface_camera:libcamera_proxy_1.0",
63    "drivers_interface_camera:libcamera_proxy_1.1",
64    "drivers_interface_camera:metadata",
65    "drivers_peripheral_display:hdi_gralloc_client",
66    "graphic_2d:librender_service_client",
67    "graphic_surface:surface",
68    "hdf_core:libhdi",
69    "hicollie:libhicollie",
70    "hilog:libhilog",
71    "hisysevent:libhisysevent",
72    "hitrace:hitrace_meter",
73    "ipc:ipc_core",
74    "ipc:ipc_single",
75    "safwk:system_ability_fwk",
76    "samgr:samgr_proxy",
77    "window_manager:libdm",
78  ]
79}
80
81group("fuzztest") {
82  testonly = true
83  deps = [ ":StreamCaptureFuzzTest" ]
84}
85