1# Copyright (c) 2021 - 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/ohos.gni")
15import("//build/test.gni")
16import("../../../../../hdf_core/adapter/uhdf2/uhdf.gni")
17import("../../../camera.gni")
18
19module_output_path = "drivers_peripheral_camera/drivers_peripheral_camera"
20camera_test_path = "//drivers/peripheral/camera/test/hdi/"
21
22config("stream_operator_config") {
23  visibility = [ ":*" ]
24  cflags_cc = [
25    "-DGST_DISABLE_DEPRECATED",
26    "-DHAVE_CONFIG_H",
27    "-DCOLORSPACE=\"videoconvert\"",
28  ]
29}
30
31ohos_fuzztest("stream_operator_fuzztest") {
32  testonly = true
33  module_out_path = module_output_path
34  fuzz_config_file = "$camera_path/../../test/fuzztest/stream_operator"
35  sources = [
36    "../common/src/common.cpp",
37    "./stream_operator_fuzzer.cpp",
38  ]
39
40  include_dirs = [
41    # common includes
42    "../common/include",
43    "$camera_test_path/v1_2/include",
44    "$camera_path/../../../display/interfaces/include",
45    "$camera_path/../../../display/hdi_service/gralloc/include",
46    "$camera_path/../../interfaces/include",
47    "$camera_path/include",
48  ]
49
50  cflags = [
51    "-g",
52    "-O0",
53    "-Wno-unused-variable",
54    "-fno-omit-frame-pointer",
55  ]
56
57  if (is_standard_system) {
58    external_deps = [
59      "c_utils:utils",
60      "hdf_core:libhdf_host",
61      "hdf_core:libhdf_ipc_adapter",
62      "hdf_core:libhdf_utils",
63      "hdf_core:libhdi",
64      "hilog:libhilog",
65      "ipc:ipc_single",
66    ]
67  } else {
68    external_deps = [ "hilog:libhilog" ]
69  }
70
71  external_deps += [
72    "drivers_interface_camera:libbuffer_producer_sequenceable_1.0",
73    "drivers_interface_camera:libcamera_proxy_1.2",
74    "drivers_interface_camera:metadata",
75    "graphic_surface:surface",
76    "samgr:samgr_proxy",
77  ]
78  public_configs = [ ":stream_operator_config" ]
79}
80
81group("fuzztest") {
82  testonly = true
83  deps = []
84  deps += [
85    # dep file
86    ":stream_operator_fuzztest",
87  ]
88}
89