blob: e70ca8c7bbe2aa60fd1593a36809c25577769b09 [file] [log] [blame]
Nathaniel Brough9d9a20d2020-08-04 16:46:56 +08001# 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 Brough3c813202021-03-23 16:30:31 +080016build --incompatible_enable_cc_toolchain_resolution
17
Nathaniel Brough9d9a20d2020-08-04 16:46:56 +080018# Required for combined code coverage reports.
Nathaniel Brough3c813202021-03-23 16:30:31 +080019coverage --experimental_generate_llvm_lcov
Nathaniel Brough9d9a20d2020-08-04 16:46:56 +080020coverage --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 Broughb6b90d02021-05-11 11:32:17 +080025build --incompatible_strict_action_env
26
Nathaniel Brough0f6099f2021-08-19 13:50:39 +080027# 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.
34build --action_env=PATH
35
Nathaniel Broughb6b90d02021-05-11 11:32:17 +080036# Define the --config=asan-libfuzzer configuration.
37build:asan-libfuzzer \
38 --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
39build:asan-libfuzzer \
40 --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
Nathaniel Broughb44d95e2021-07-15 10:39:47 +080041build:asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan
42
43# Configures toolchain with polyfill headers.
44build --@rules_cc_toolchain_config//:user_defined=//pw_polyfill:toolchain_polyfill_overrides
Jared Weinstein7c658f62021-07-19 12:59:44 -070045
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).
54test --test_output=errors