Robert Szewczyk | 38cf731 | 2020-06-29 09:07:49 -0700 | [diff] [blame] | 1 | # 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 Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
Robert Szewczyk | 38cf731 | 2020-06-29 09:07:49 -0700 | [diff] [blame] | 8 | # |
| 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 Szewczyk | 38cf731 | 2020-06-29 09:07:49 -0700 | [diff] [blame] | 14 | |
Song GUO | aea81e3 | 2021-09-11 12:07:22 +0800 | [diff] [blame] | 15 | import("//build_overrides/build.gni") |
Michael Spang | df71298 | 2020-09-18 10:39:35 -0400 | [diff] [blame] | 16 | import("//build_overrides/chip.gni") |
| 17 | |
Amine Alami | ab42d43 | 2024-06-19 21:51:25 +0200 | [diff] [blame] | 18 | import("${chip_root}/build/chip/tools.gni") |
Michael Spang | df71298 | 2020-09-18 10:39:35 -0400 | [diff] [blame] | 19 | import("${chip_root}/src/platform/device.gni") |
| 20 | |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 21 | declare_args() { |
Maksymilian Knust | 686e73b | 2024-06-25 07:47:08 +0200 | [diff] [blame] | 22 | # Build monolithic test library. |
| 23 | chip_monolithic_tests = false |
| 24 | } |
| 25 | |
| 26 | declare_args() { |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 27 | # Enable building tests. |
| 28 | chip_build_tests = current_os != "freertos" |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 29 | } |
Michael Spang | 871ce0b | 2020-06-26 11:47:03 -0400 | [diff] [blame] | 30 | |
Michael Spang | 8d085b3 | 2020-07-10 10:26:23 -0400 | [diff] [blame] | 31 | declare_args() { |
Michael Spang | df71298 | 2020-09-18 10:39:35 -0400 | [diff] [blame] | 32 | # Build executables for running individual tests. |
Arkadiusz Bokowy | 454d7d9 | 2023-08-29 20:45:34 +0200 | [diff] [blame] | 33 | chip_link_tests = chip_build_tests && |
| 34 | (current_os == "linux" || current_os == "mac" || |
| 35 | current_os == "tizen") && current_cpu == target_cpu |
| 36 | } |
rgoliver | d939393 | 2021-08-11 15:59:23 -0400 | [diff] [blame] | 37 | |
Arkadiusz Bokowy | 454d7d9 | 2023-08-29 20:45:34 +0200 | [diff] [blame] | 38 | declare_args() { |
| 39 | # Run tests with pigweed test runner. |
| 40 | chip_pw_run_tests = chip_link_tests && current_os != "tizen" |
| 41 | } |
| 42 | |
| 43 | declare_args() { |
rgoliver | d939393 | 2021-08-11 15:59:23 -0400 | [diff] [blame] | 44 | # Use source_set instead of static_lib for tests. |
| 45 | chip_build_test_static_libraries = chip_device_platform != "efr32" |
Michael Spang | df71298 | 2020-09-18 10:39:35 -0400 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | declare_args() { |
Amine Alami | ab42d43 | 2024-06-19 21:51:25 +0200 | [diff] [blame] | 49 | # Enable use of nlfaultinjection when building tests or when building tools. |
| 50 | chip_with_nlfaultinjection = chip_build_tests || chip_build_tools |
Michael Spang | efa630b | 2020-07-08 22:23:08 -0400 | [diff] [blame] | 51 | } |