# Copyright (c) 2020 Project CHIP 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("//build_overrides/chip.gni")

import("${chip_root}/build/chip/tools.gni")
import("${chip_root}/src/platform/device.gni")

declare_args() {
  # Build monolithic test library.
  chip_monolithic_tests = false
}

declare_args() {
  # Enable building tests.
  chip_build_tests = current_os != "freertos"

  # Enabling useful support functions when building using GoogleTest framework (used in unit tests and pw_fuzzer FuzzTests)
  # For unit tests: this should only be enabled through build_examples.py, see PR #36268
  chip_build_tests_googletest = false
}

declare_args() {
  # Build executables for running individual tests.
  chip_link_tests = chip_build_tests &&
                    (current_os == "linux" || current_os == "mac" ||
                     current_os == "tizen") && current_cpu == target_cpu
}

declare_args() {
  # Run tests with pigweed test runner.
  chip_pw_run_tests = chip_link_tests && current_os != "tizen"
}

declare_args() {
  # Use source_set instead of static_lib for tests.
  chip_build_test_static_libraries = chip_device_platform != "efr32"
}

declare_args() {
  # Enable use of nlfaultinjection when building tests or when building tools.
  chip_with_nlfaultinjection = chip_build_tests || chip_build_tools
}
