132a6e48fSopenharmony_ci# Copyright (c) 2022 Huawei Device Co., Ltd.
232a6e48fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
332a6e48fSopenharmony_ci# you may not use this file except in compliance with the License.
432a6e48fSopenharmony_ci# You may obtain a copy of the License at
532a6e48fSopenharmony_ci#
632a6e48fSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
732a6e48fSopenharmony_ci#
832a6e48fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
932a6e48fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1032a6e48fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1132a6e48fSopenharmony_ci# See the License for the specific language governing permissions and
1232a6e48fSopenharmony_ci# limitations under the License.
1332a6e48fSopenharmony_ci
1432a6e48fSopenharmony_ci#####################hydra-fuzz###################
1532a6e48fSopenharmony_ciimport("//build/config/features.gni")
1632a6e48fSopenharmony_ciimport("//build/test.gni")
1732a6e48fSopenharmony_ciimport("//foundation/graphic/graphic_surface/graphic_surface_config.gni")
1832a6e48fSopenharmony_cimodule_output_path = "graphic_surface/graphic_surface"
1932a6e48fSopenharmony_ci
2032a6e48fSopenharmony_ci##############################fuzztest##########################################
2132a6e48fSopenharmony_ciohos_fuzztest("NativeBufferFuzzTest") {
2232a6e48fSopenharmony_ci  fuzz_config_file = "//foundation/graphic/graphic_surface/surface/test/fuzztest/nativebuffer_fuzzer"
2332a6e48fSopenharmony_ci  module_out_path = module_output_path
2432a6e48fSopenharmony_ci
2532a6e48fSopenharmony_ci  include_dirs = [
2632a6e48fSopenharmony_ci    "$graphic_surface_root/surface/include",
2732a6e48fSopenharmony_ci    "$graphic_surface_root/interfaces/inner_api/surface",
2832a6e48fSopenharmony_ci    "$graphic_surface_root/surface/test/fuzztest/common",
2932a6e48fSopenharmony_ci  ]
3032a6e48fSopenharmony_ci  cflags = [
3132a6e48fSopenharmony_ci    "-g",
3232a6e48fSopenharmony_ci    "-O0",
3332a6e48fSopenharmony_ci    "-Wno-unused-variable",
3432a6e48fSopenharmony_ci    "-fno-omit-frame-pointer",
3532a6e48fSopenharmony_ci  ]
3632a6e48fSopenharmony_ci  sources = [ "nativebuffer_fuzzer.cpp" ]
3732a6e48fSopenharmony_ci  deps = [ "$graphic_surface_root/surface:surface" ]
3832a6e48fSopenharmony_ci  external_deps = [
3932a6e48fSopenharmony_ci    "c_utils:utils",
4032a6e48fSopenharmony_ci    "hilog:libhilog",
4132a6e48fSopenharmony_ci    "ipc:ipc_single",
4232a6e48fSopenharmony_ci  ]
4332a6e48fSopenharmony_ci}
4432a6e48fSopenharmony_ci
4532a6e48fSopenharmony_ci###############################################################################
4632a6e48fSopenharmony_cigroup("fuzztest") {
4732a6e48fSopenharmony_ci  testonly = true
4832a6e48fSopenharmony_ci  deps = []
4932a6e48fSopenharmony_ci  deps += [
5032a6e48fSopenharmony_ci    # deps file
5132a6e48fSopenharmony_ci    ":NativeBufferFuzzTest",
5232a6e48fSopenharmony_ci  ]
5332a6e48fSopenharmony_ci}
5432a6e48fSopenharmony_ci###############################################################################
55