# Copyright 2023 The Dawn & Tint Authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
#    list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
#    this list of conditions and the following disclaimer in the documentation
#    and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
#    contributors may be used to endorse or promote products derived from
#    this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Build flag for dawn lpm fuzzers

import("../../../scripts/dawn_overrides_with_defaults.gni")

import("//build_overrides/build.gni")
import("//testing/libfuzzer/fuzzer_test.gni")

declare_args() {
  is_dawn_lpm_fuzzer = is_linux
}

template("dawn_lpm_template") {
  # Extract some common parameters (if needed)
  assert(is_dawn_lpm_fuzzer)
  assert(defined(invoker.dawn_lpm_sources))
  assert(defined(invoker.defines))

  fuzzer_test("${target_name}") {
    sources = invoker.dawn_lpm_sources
    defines = invoker.defines
    deps = [
      ":dawn_lpm_proto",
      ":dawn_lpmfuzz_cpp",
      "${dawn_root}/include/dawn:cpp_headers",
      "${dawn_root}/src/dawn:proc",
      "${dawn_root}/src/dawn/common",
      "${dawn_root}/src/dawn/native:static",
      "${dawn_root}/src/dawn/utils",
      "${dawn_root}/src/dawn/wire:static",
      "//third_party/libprotobuf-mutator",
    ]

    libfuzzer_options = [
      "max_len=2111000",
      "len_control=0",
    ]
  }
}
