Nathaniel Brough | 9d9a20d | 2020-08-04 16:46:56 +0800 | [diff] [blame] | 1 | # Copyright 2021 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 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, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
| 14 | |
| 15 | # Required for new toolchain resolution API. |
Nathaniel Brough | 3c81320 | 2021-03-23 16:30:31 +0800 | [diff] [blame] | 16 | build --incompatible_enable_cc_toolchain_resolution |
| 17 | |
Nathaniel Brough | 9d9a20d | 2020-08-04 16:46:56 +0800 | [diff] [blame] | 18 | # Required for combined code coverage reports. |
Nathaniel Brough | 3c81320 | 2021-03-23 16:30:31 +0800 | [diff] [blame] | 19 | coverage --experimental_generate_llvm_lcov |
Nathaniel Brough | 9d9a20d | 2020-08-04 16:46:56 +0800 | [diff] [blame] | 20 | coverage --combined_report=lcov |
| 21 | |
| 22 | # Enforces consistent action environment variables. This is important to |
| 23 | # address Protobuf's rebuild sensitivity on changes to the environment |
| 24 | # variables. |
Nathaniel Brough | b6b90d0 | 2021-05-11 11:32:17 +0800 | [diff] [blame] | 25 | build --incompatible_strict_action_env |
| 26 | |
Nathaniel Brough | 0f6099f | 2021-08-19 13:50:39 +0800 | [diff] [blame] | 27 | # This leaks the PATH variable into the Bazel build environment, which |
| 28 | # enables the Python pw_protobuf plugins to find the Python version |
| 29 | # via CIPD and pw_env_setup. This is a partial fix for pwbug/437, |
| 30 | # however this does not provide a fix for downstream projects that |
| 31 | # use system Python < 3.6. This approach is problematic because of the |
| 32 | # Protobuf rebuild sensitivity to environment variable changes. |
| 33 | # TODO(pwbug/437): Remove this once pwbug/437 is completely resolved. |
| 34 | build --action_env=PATH |
| 35 | |
Nathaniel Brough | b6b90d0 | 2021-05-11 11:32:17 +0800 | [diff] [blame] | 36 | # Define the --config=asan-libfuzzer configuration. |
| 37 | build:asan-libfuzzer \ |
| 38 | --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer |
| 39 | build:asan-libfuzzer \ |
| 40 | --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer |
Nathaniel Brough | b44d95e | 2021-07-15 10:39:47 +0800 | [diff] [blame] | 41 | build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan |
| 42 | |
| 43 | # Configures toolchain with polyfill headers. |
| 44 | build --@rules_cc_toolchain_config//:user_defined=//pw_polyfill:toolchain_polyfill_overrides |
Jared Weinstein | 7c658f6 | 2021-07-19 12:59:44 -0700 | [diff] [blame] | 45 | |
| 46 | # Specifies desired output mode for running tests. |
| 47 | # Valid values are |
| 48 | # 'summary' to output only test status summary |
| 49 | # 'errors' to also print test logs for failed tests |
| 50 | # 'all' to print logs for all tests |
| 51 | # 'streamed' to output logs for all tests in real time |
| 52 | # (this will force tests to be executed locally one at a time regardless |
| 53 | # of --test_strategy value). |
| 54 | test --test_output=errors |