# Copyright 2022 The Dawn & Tint Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/build.gni")
import("../../../tint_overrides_with_defaults.gni")

# Fuzzers - Libfuzzer based fuzzing targets for Chromium
# To run the fuzzers outside of Chromium, use the CMake based builds.

if (build_with_chromium) {
  import("//testing/libfuzzer/fuzzer_test.gni")
  import("../../../scripts/dawn_overrides_with_defaults.gni")

  fuzzer_corpus_wgsl_dir = "${target_gen_dir}/fuzzer_corpus_wgsl"
  fuzzer_corpus_wgsl_stamp = "${fuzzer_corpus_wgsl_dir}.stamp"
  action("tint_generate_wgsl_corpus") {
    script = "generate_wgsl_corpus.py"
    sources = [ "generate_wgsl_corpus.py" ]
    args = [
      "--stamp=" + rebase_path(fuzzer_corpus_wgsl_stamp, root_build_dir),
      rebase_path("${tint_root_dir}/test", root_build_dir),
      rebase_path(fuzzer_corpus_wgsl_dir, root_build_dir),
    ]
    outputs = [ fuzzer_corpus_wgsl_stamp ]
  }

  tint_fuzzer_common_libfuzzer_options = [
    "only_ascii=1",
    "max_len=10000",
  ]

  tint_ast_fuzzer_common_libfuzzer_options =
      tint_fuzzer_common_libfuzzer_options + [
        "cross_over=0",
        "mutate_depth=1",
        "tint_enable_all_mutations=false",
        "tint_mutation_batch_size=5",
      ]

  tint_regex_fuzzer_common_libfuzzer_options =
      tint_fuzzer_common_libfuzzer_options + [
        "cross_over=0",
        "mutate_depth=1",
      ]

  # fuzzer_test doesn't have configs members, so need to define them in an empty
  # source_set.

  source_set("tint_fuzzer_common_src") {
    public_configs = [
      "${tint_root_dir}/src/tint:tint_config",
      "${tint_root_dir}/src/tint:tint_common_config",
    ]

    public_deps = [
      "${tint_root_dir}/src/tint:libtint",
      "${tint_spirv_tools_dir}/:spvtools_val",
    ]

    sources = [
      "apply_substitute_overrides.cc",
      "apply_substitute_overrides.h",
      "data_builder.h",
      "mersenne_twister_engine.cc",
      "mersenne_twister_engine.h",
      "random_generator.cc",
      "random_generator.h",
      "random_generator_engine.cc",
      "random_generator_engine.h",
      "shuffle_transform.cc",
      "shuffle_transform.h",
      "tint_common_fuzzer.cc",
      "tint_common_fuzzer.h",
      "tint_reader_writer_fuzzer.h",
      "transform_builder.h",
    ]

    if (is_mac) {
      sources += [ "//testing/libfuzzer/libfuzzer_exports.h" ]
    }
  }

  source_set("tint_fuzzer_common_with_init_src") {
    public_deps = [ ":tint_fuzzer_common_src" ]

    sources = [
      "cli.cc",
      "cli.h",
      "fuzzer_init.cc",
      "fuzzer_init.h",
    ]
  }

  if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
    fuzzer_test("tint_ast_clone_fuzzer") {
      sources = [ "tint_ast_clone_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_ast_wgsl_writer_fuzzer") {
      sources = [ "tint_ast_fuzzer/tint_ast_wgsl_writer_fuzzer.cc" ]
      deps = [ "tint_ast_fuzzer:tint_ast_fuzzer" ]
      libfuzzer_options = tint_ast_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_regex_wgsl_writer_fuzzer") {
      sources = [ "tint_regex_fuzzer/tint_regex_wgsl_writer_fuzzer.cc" ]
      deps = [ "tint_regex_fuzzer:tint_regex_fuzzer" ]
      libfuzzer_options = tint_regex_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_wgsl_reader_wgsl_writer_fuzzer") {
      sources = [ "tint_wgsl_reader_wgsl_writer_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }
  }

  if (tint_build_wgsl_reader && tint_build_spv_writer) {
    fuzzer_test("tint_all_transforms_fuzzer") {
      sources = [ "tint_all_transforms_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_ast_spv_writer_fuzzer") {
      sources = [ "tint_ast_fuzzer/tint_ast_spv_writer_fuzzer.cc" ]
      deps = [ "tint_ast_fuzzer:tint_ast_fuzzer" ]
      libfuzzer_options = tint_ast_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_binding_remapper_fuzzer") {
      sources = [ "tint_binding_remapper_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    # Disable this fuzzer on windows + ASAN. See crbug.com/1357188.
    if (!(is_win && is_asan)) {
      fuzzer_test("tint_concurrency_fuzzer") {
        sources = [ "tint_concurrency_fuzzer.cc" ]
        deps = [ ":tint_fuzzer_common_with_init_src" ]
        dict = "dictionary.txt"
        libfuzzer_options = tint_fuzzer_common_libfuzzer_options
        seed_corpus = fuzzer_corpus_wgsl_dir
        seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
      }
    }

    fuzzer_test("tint_first_index_offset_fuzzer") {
      sources = [ "tint_first_index_offset_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_regex_spv_writer_fuzzer") {
      sources = [ "tint_regex_fuzzer/tint_regex_spv_writer_fuzzer.cc" ]
      deps = [ "tint_regex_fuzzer:tint_regex_fuzzer" ]
      libfuzzer_options = tint_regex_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_renamer_fuzzer") {
      sources = [ "tint_renamer_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_robustness_fuzzer") {
      sources = [ "tint_robustness_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_single_entry_point_fuzzer") {
      sources = [ "tint_single_entry_point_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_vertex_pulling_fuzzer") {
      sources = [ "tint_vertex_pulling_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_wgsl_reader_spv_writer_fuzzer") {
      sources = [ "tint_wgsl_reader_spv_writer_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }
  }

  if (tint_build_wgsl_reader && tint_build_hlsl_writer) {
    fuzzer_test("tint_ast_hlsl_writer_fuzzer") {
      sources = [ "tint_ast_fuzzer/tint_ast_hlsl_writer_fuzzer.cc" ]
      deps = [ "tint_ast_fuzzer:tint_ast_fuzzer" ]
      libfuzzer_options = tint_ast_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_regex_hlsl_writer_fuzzer") {
      sources = [ "tint_regex_fuzzer/tint_regex_hlsl_writer_fuzzer.cc" ]
      deps = [ "tint_regex_fuzzer:tint_regex_fuzzer" ]
      libfuzzer_options = tint_regex_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_wgsl_reader_hlsl_writer_fuzzer") {
      sources = [ "tint_wgsl_reader_hlsl_writer_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }
  }

  if (tint_build_wgsl_reader && tint_build_msl_writer) {
    fuzzer_test("tint_ast_msl_writer_fuzzer") {
      sources = [ "tint_ast_fuzzer/tint_ast_msl_writer_fuzzer.cc" ]
      deps = [ "tint_ast_fuzzer:tint_ast_fuzzer" ]
      libfuzzer_options = tint_ast_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_regex_msl_writer_fuzzer") {
      sources = [ "tint_regex_fuzzer/tint_regex_msl_writer_fuzzer.cc" ]
      deps = [ "tint_regex_fuzzer:tint_regex_fuzzer" ]
      libfuzzer_options = tint_regex_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }

    fuzzer_test("tint_wgsl_reader_msl_writer_fuzzer") {
      sources = [ "tint_wgsl_reader_msl_writer_fuzzer.cc" ]
      deps = [ ":tint_fuzzer_common_with_init_src" ]
      dict = "dictionary.txt"
      libfuzzer_options = tint_fuzzer_common_libfuzzer_options
      seed_corpus = fuzzer_corpus_wgsl_dir
      seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
    }
  }

  if (tint_build_wgsl_reader && tint_build_hlsl_writer &&
      tint_build_msl_writer && tint_build_spv_writer &&
      tint_build_wgsl_writer) {
    executable("tint_black_box_fuzz_target") {
      sources = [ "tint_black_box_fuzz_target.cc" ]
      deps = [ ":tint_fuzzer_common_src" ]
    }
  }

  group("fuzzers") {
    testonly = true
    deps = []

    if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
      deps += [
        ":tint_ast_clone_fuzzer",
        ":tint_ast_wgsl_writer_fuzzer",
        ":tint_regex_wgsl_writer_fuzzer",
        ":tint_wgsl_reader_wgsl_writer_fuzzer",
      ]
    }
    if (tint_build_wgsl_reader && tint_build_spv_writer) {
      deps += [
        ":tint_all_transforms_fuzzer",
        ":tint_ast_spv_writer_fuzzer",
        ":tint_binding_remapper_fuzzer",
        ":tint_first_index_offset_fuzzer",
        ":tint_regex_spv_writer_fuzzer",
        ":tint_renamer_fuzzer",
        ":tint_robustness_fuzzer",
        ":tint_single_entry_point_fuzzer",
        ":tint_vertex_pulling_fuzzer",
        ":tint_wgsl_reader_spv_writer_fuzzer",
      ]
    }
    if (tint_build_wgsl_reader && tint_build_hlsl_writer) {
      deps += [
        ":tint_ast_hlsl_writer_fuzzer",
        ":tint_regex_hlsl_writer_fuzzer",
        ":tint_wgsl_reader_hlsl_writer_fuzzer",
      ]
    }
    if (tint_build_wgsl_reader && tint_build_msl_writer) {
      deps += [
        ":tint_ast_msl_writer_fuzzer",
        ":tint_regex_msl_writer_fuzzer",
        ":tint_wgsl_reader_msl_writer_fuzzer",
      ]
    }
    if (tint_build_wgsl_reader && tint_build_hlsl_writer &&
        tint_build_msl_writer && tint_build_spv_writer &&
        tint_build_wgsl_writer) {
      deps += [ ":tint_black_box_fuzz_target" ]
    }
  }
} else {
  group("fuzzers") {
  }
}
