blob: 0c2c742d646a1550dafd54d9c88ec22c82c704ca [file] [log] [blame]
Robert Szewczyk38cf7312020-06-29 09:07:49 -07001# Copyright (c) 2020 Project CHIP Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
Michael Spangefa630b2020-07-08 22:23:08 -04007# http://www.apache.org/licenses/LICENSE-2.0
Robert Szewczyk38cf7312020-06-29 09:07:49 -07008#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
Robert Szewczyk38cf7312020-06-29 09:07:49 -070014
Song GUOaea81e32021-09-11 12:07:22 +080015import("//build_overrides/build.gni")
Michael Spangdf712982020-09-18 10:39:35 -040016import("//build_overrides/chip.gni")
17
Amine Alamiab42d432024-06-19 21:51:25 +020018import("${chip_root}/build/chip/tools.gni")
Michael Spangdf712982020-09-18 10:39:35 -040019import("${chip_root}/src/platform/device.gni")
20
Michael Spangefa630b2020-07-08 22:23:08 -040021declare_args() {
Maksymilian Knust686e73b2024-06-25 07:47:08 +020022 # Build monolithic test library.
23 chip_monolithic_tests = false
24}
25
26declare_args() {
Michael Spangefa630b2020-07-08 22:23:08 -040027 # Enable building tests.
28 chip_build_tests = current_os != "freertos"
Michael Spang8d085b32020-07-10 10:26:23 -040029}
Michael Spang871ce0b2020-06-26 11:47:03 -040030
Michael Spang8d085b32020-07-10 10:26:23 -040031declare_args() {
Michael Spangdf712982020-09-18 10:39:35 -040032 # Build executables for running individual tests.
Arkadiusz Bokowy454d7d92023-08-29 20:45:34 +020033 chip_link_tests = chip_build_tests &&
34 (current_os == "linux" || current_os == "mac" ||
35 current_os == "tizen") && current_cpu == target_cpu
36}
rgoliverd9393932021-08-11 15:59:23 -040037
Arkadiusz Bokowy454d7d92023-08-29 20:45:34 +020038declare_args() {
39 # Run tests with pigweed test runner.
40 chip_pw_run_tests = chip_link_tests && current_os != "tizen"
41}
42
43declare_args() {
rgoliverd9393932021-08-11 15:59:23 -040044 # Use source_set instead of static_lib for tests.
45 chip_build_test_static_libraries = chip_device_platform != "efr32"
Michael Spangdf712982020-09-18 10:39:35 -040046}
47
48declare_args() {
Amine Alamiab42d432024-06-19 21:51:25 +020049 # Enable use of nlfaultinjection when building tests or when building tools.
50 chip_with_nlfaultinjection = chip_build_tests || chip_build_tools
Michael Spangefa630b2020-07-08 22:23:08 -040051}