# 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.

################################################################################
# File generated by 'tools/src/cmd/gen' using the template:
#   tools/src/cmd/gen/build/BUILD.gn.tmpl
#
# To regenerate run: './tools/run gen'
#
#                       Do not modify this file directly
################################################################################

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

import("${tint_src_dir}/tint.gni")

if (tint_build_unittests || tint_build_benchmarks) {
  import("//testing/test.gni")
}
if (tint_build_unittests) {
  test("test_cmd") {
    testonly = true
    output_name = "tint_unittests"
    sources = [ "main_test.cc" ]
    deps = [
      "${tint_src_dir}:gmock_and_gtest",
      "${tint_src_dir}/api",
      "${tint_src_dir}/api/common:unittests",
      "${tint_src_dir}/api/options:unittests",
      "${tint_src_dir}/cmd/common:unittests",
      "${tint_src_dir}/lang/core:unittests",
      "${tint_src_dir}/lang/core/constant:unittests",
      "${tint_src_dir}/lang/core/intrinsic:unittests",
      "${tint_src_dir}/lang/core/ir:unittests",
      "${tint_src_dir}/lang/core/ir/transform:unittests",
      "${tint_src_dir}/lang/core/ir/transform/common:unittests",
      "${tint_src_dir}/lang/core/type:unittests",
      "${tint_src_dir}/lang/hlsl/writer/common:unittests",
      "${tint_src_dir}/lang/msl/ir:unittests",
      "${tint_src_dir}/lang/spirv/ir:unittests",
      "${tint_src_dir}/lang/spirv/reader/lower:unittests",
      "${tint_src_dir}/lang/spirv/type:unittests",
      "${tint_src_dir}/lang/wgsl:unittests",
      "${tint_src_dir}/lang/wgsl/ast:unittests",
      "${tint_src_dir}/lang/wgsl/common:unittests",
      "${tint_src_dir}/lang/wgsl/helpers:unittests",
      "${tint_src_dir}/lang/wgsl/intrinsic:unittests",
      "${tint_src_dir}/lang/wgsl/program:unittests",
      "${tint_src_dir}/lang/wgsl/reader/lower:unittests",
      "${tint_src_dir}/lang/wgsl/resolver:unittests",
      "${tint_src_dir}/lang/wgsl/sem:unittests",
      "${tint_src_dir}/lang/wgsl/writer/ir_to_program:unittests",
      "${tint_src_dir}/lang/wgsl/writer/raise:unittests",
      "${tint_src_dir}/utils/bytes:unittests",
      "${tint_src_dir}/utils/cli:unittests",
      "${tint_src_dir}/utils/command:unittests",
      "${tint_src_dir}/utils/containers:unittests",
      "${tint_src_dir}/utils/diagnostic:unittests",
      "${tint_src_dir}/utils/file:unittests",
      "${tint_src_dir}/utils/ice:unittests",
      "${tint_src_dir}/utils/macros:unittests",
      "${tint_src_dir}/utils/math:unittests",
      "${tint_src_dir}/utils/memory:unittests",
      "${tint_src_dir}/utils/reflection:unittests",
      "${tint_src_dir}/utils/result:unittests",
      "${tint_src_dir}/utils/rtti:unittests",
      "${tint_src_dir}/utils/strconv:unittests",
      "${tint_src_dir}/utils/symbol:unittests",
      "${tint_src_dir}/utils/text:unittests",
      "${tint_src_dir}/utils/traits:unittests",
    ]

    if (tint_build_glsl_writer) {
      deps += [
        "${tint_src_dir}/lang/glsl/writer/ast_printer:unittests",
        "${tint_src_dir}/lang/glsl/writer/common:unittests",
        "${tint_src_dir}/lang/glsl/writer/printer:unittests",
      ]
    }

    if (tint_build_glsl_writer && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/glsl/writer/ast_raise:unittests" ]
    }

    if (tint_build_hlsl_writer) {
      deps += [ "${tint_src_dir}/lang/hlsl/writer/ast_printer:unittests" ]
    }

    if (tint_build_hlsl_writer && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/hlsl/writer/ast_raise:unittests" ]
    }

    if (tint_build_ir_binary) {
      deps += [ "${tint_src_dir}/lang/core/ir/binary:unittests" ]
    }

    if (tint_build_msl_writer) {
      deps += [
        "${tint_src_dir}/lang/msl/writer:unittests",
        "${tint_src_dir}/lang/msl/writer/ast_printer:unittests",
        "${tint_src_dir}/lang/msl/writer/common:unittests",
        "${tint_src_dir}/lang/msl/writer/raise:unittests",
      ]
    }

    if (tint_build_msl_writer && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/msl/writer/ast_raise:unittests" ]
    }

    if (tint_build_spv_reader) {
      deps += [
        "${tint_src_dir}/lang/spirv/reader:unittests",
        "${tint_src_dir}/lang/spirv/reader/common:unittests",
        "${tint_src_dir}/lang/spirv/reader/parser:unittests",
      ]
    }

    if (tint_build_spv_reader && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/spirv/reader/ast_lower:unittests" ]
    }

    if (tint_build_spv_reader && tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/spirv/reader/ast_parser:unittests" ]
    }

    if (tint_build_spv_reader || tint_build_spv_writer) {
      deps += [ "${tint_src_dir}/lang/spirv/validate:unittests" ]
    }

    if (tint_build_spv_writer) {
      deps += [
        "${tint_src_dir}/lang/spirv/writer:unittests",
        "${tint_src_dir}/lang/spirv/writer/ast_printer:unittests",
        "${tint_src_dir}/lang/spirv/writer/common:unittests",
        "${tint_src_dir}/lang/spirv/writer/raise:unittests",
      ]
    }

    if (tint_build_spv_writer && tint_build_wgsl_reader &&
        tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/spirv/writer/ast_raise:unittests" ]
    }

    if (tint_build_tintd && tint_build_wgsl_reader) {
      deps += [ "${tint_src_dir}/lang/wgsl/ls:unittests" ]
    }

    if (tint_build_wgsl_reader) {
      deps += [
        "${tint_src_dir}/lang/wgsl/inspector:unittests",
        "${tint_src_dir}/lang/wgsl/reader:unittests",
        "${tint_src_dir}/lang/wgsl/reader/parser:unittests",
        "${tint_src_dir}/lang/wgsl/reader/program_to_ir:unittests",
      ]
    }

    if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
      deps += [ "${tint_src_dir}/lang/wgsl/ast/transform:unittests" ]
    }

    if (tint_build_wgsl_writer) {
      deps += [
        "${tint_src_dir}/lang/wgsl/writer:unittests",
        "${tint_src_dir}/lang/wgsl/writer/ast_printer:unittests",
      ]
    }
    configs += [ "${tint_src_dir}:tint_unittests_config" ]

    if (build_with_chromium) {
      configs -= [ "//build/config/compiler:chromium_code" ]
      configs += [ "//build/config/compiler:no_chromium_code" ]
    }
  }
}
