Skip to content

Commit

Permalink
#Centipede Add address-sanitized puzzles into the test workflow.
Browse files Browse the repository at this point in the history
Other tests would require more changes to be able to run with sanitizers. So we add only puzzles first.

PiperOrigin-RevId: 579295426
  • Loading branch information
xinhaoyuan authored and copybara-github committed Nov 3, 2023
1 parent eeacf4d commit 7242af3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion centipede/puzzles/puzzle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def puzzle(name):
data = [
":" + name,
name + ".cc",
"@com_google_fuzztest//centipede",
"@com_google_fuzztest//centipede:centipede_uninstrumented",
"@com_google_fuzztest//centipede:test_util_sh",
],
)
2 changes: 1 addition & 1 deletion centipede/puzzles/run_puzzle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ls -la "$(dirname "$0")"
source "$(dirname "$0")/../test_util.sh"

readonly centipede_dir="$(centipede::get_centipede_test_srcdir)"
centipede::maybe_set_var_to_executable_path centipede "${centipede_dir}/centipede"
centipede::maybe_set_var_to_executable_path centipede "${centipede_dir}/centipede_uninstrumented"
readonly centipede

readonly target_name="$(basename "$0")"
Expand Down
2 changes: 2 additions & 0 deletions centipede/run_test_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ bazel test "${BAZEL_ARGS[@]}" --local_test_jobs=1 --test_output=streamed \
centipede:all &&
bazel test "${BAZEL_ARGS[@]}" centipede/testing:instrumentation_test centipede/testing:runner_test &&
bazel test "${BAZEL_ARGS[@]}" centipede/puzzles:all
bazel test "${BAZEL_ARGS[@]}" --linkopt=-fsanitize=address --copt=-fsanitize=address centipede/puzzles:all

declare -ri exit_code=$?
set -e

Expand Down
2 changes: 1 addition & 1 deletion centipede/testing/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ affect all its transitive dependencies as well.
# Change the flags from the default ones to sancov:
# https://clang.llvm.org/docs/SanitizerCoverage.html.
def _sancov_transition_impl(settings, attr):
features_to_strip = ["asan", "tsan", "msan"]
features_to_strip = ["tsan", "msan"]
filtered_features = [
x
for x in settings["//command_line_option:features"]
Expand Down

0 comments on commit 7242af3

Please sign in to comment.