From 7242af397f9e5b8ca5fcd1a167caaa072b60df27 Mon Sep 17 00:00:00 2001 From: Xinhao Yuan Date: Fri, 3 Nov 2023 13:48:39 -0700 Subject: [PATCH] #Centipede Add address-sanitized puzzles into the test workflow. Other tests would require more changes to be able to run with sanitizers. So we add only puzzles first. PiperOrigin-RevId: 579295426 --- centipede/puzzles/puzzle.bzl | 2 +- centipede/puzzles/run_puzzle.sh | 2 +- centipede/run_test_workflow.sh | 2 ++ centipede/testing/build_defs.bzl | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/centipede/puzzles/puzzle.bzl b/centipede/puzzles/puzzle.bzl index 97d44304..3be02421 100644 --- a/centipede/puzzles/puzzle.bzl +++ b/centipede/puzzles/puzzle.bzl @@ -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", ], ) diff --git a/centipede/puzzles/run_puzzle.sh b/centipede/puzzles/run_puzzle.sh index cfe0e55f..799f7212 100755 --- a/centipede/puzzles/run_puzzle.sh +++ b/centipede/puzzles/run_puzzle.sh @@ -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")" diff --git a/centipede/run_test_workflow.sh b/centipede/run_test_workflow.sh index a88054aa..e15016f1 100755 --- a/centipede/run_test_workflow.sh +++ b/centipede/run_test_workflow.sh @@ -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 diff --git a/centipede/testing/build_defs.bzl b/centipede/testing/build_defs.bzl index d7d8d2d1..ec3878f0 100644 --- a/centipede/testing/build_defs.bzl +++ b/centipede/testing/build_defs.bzl @@ -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"]