From e5ae6ad9cf72e62fe19a7c9678f15b677d95284a Mon Sep 17 00:00:00 2001 From: Ted Pudlik Date: Mon, 10 Feb 2025 15:44:11 -0800 Subject: [PATCH] bazel: Run sanitizers with googletest config too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add appropriate tags to all pre-existing violations so that we can start enforcing this elsewhere. Bug: 393655143 Change-Id: I652a20ecb361a585352e715652ac6b536637b8e2 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/266914 Lint: Lint 🤖 Reviewed-by: Faraaz Sareshwala Commit-Queue: Ted Pudlik Docs-Not-Needed: Ted Pudlik --- pigweed.json | 18 ++++++++++++++++++ pw_bluetooth_sapphire/BUILD.bazel | 4 ++++ pw_bluetooth_sapphire/host/common/BUILD.bazel | 2 ++ pw_bluetooth_sapphire/host/gap/BUILD.bazel | 5 +++++ pw_bluetooth_sapphire/host/gatt/BUILD.bazel | 2 ++ pw_bluetooth_sapphire/host/hci/BUILD.bazel | 2 ++ pw_bluetooth_sapphire/host/iso/BUILD.bazel | 5 +++++ pw_bluetooth_sapphire/host/l2cap/BUILD.bazel | 4 ++++ pw_bluetooth_sapphire/host/sm/BUILD.bazel | 2 ++ 9 files changed, 44 insertions(+) diff --git a/pigweed.json b/pigweed.json index 147dde117..875c5d94a 100644 --- a/pigweed.json +++ b/pigweed.json @@ -238,15 +238,33 @@ "--config=asan", "//..." ], + [ + "test", + "--config=asan", + "--config=googletest", + "//..." + ], + [ + "test", + "--config=tsan", + "//..." + ], [ "test", "--config=tsan", + "--config=googletest", "//..." ], [ "test", "--config=ubsan", "//..." + ], + [ + "test", + "--config=ubsan", + "--config=googletest", + "//..." ] ] } diff --git a/pw_bluetooth_sapphire/BUILD.bazel b/pw_bluetooth_sapphire/BUILD.bazel index 8430fdbf5..3325a6d8b 100644 --- a/pw_bluetooth_sapphire/BUILD.bazel +++ b/pw_bluetooth_sapphire/BUILD.bazel @@ -54,6 +54,8 @@ cc_library( pw_cc_test( name = "central_test", srcs = ["central_test.cc"], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":central", @@ -80,6 +82,8 @@ cc_library( pw_cc_test( name = "peripheral_test", srcs = ["peripheral_test.cc"], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":peripheral", diff --git a/pw_bluetooth_sapphire/host/common/BUILD.bazel b/pw_bluetooth_sapphire/host/common/BUILD.bazel index 7bfeadd50..dce104d07 100644 --- a/pw_bluetooth_sapphire/host/common/BUILD.bazel +++ b/pw_bluetooth_sapphire/host/common/BUILD.bazel @@ -139,6 +139,8 @@ pw_cc_test( "weak_self_test.cc", "windowed_inspect_numeric_property_test.cc", ], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":common", diff --git a/pw_bluetooth_sapphire/host/gap/BUILD.bazel b/pw_bluetooth_sapphire/host/gap/BUILD.bazel index 0304abf2a..b150e1fb7 100644 --- a/pw_bluetooth_sapphire/host/gap/BUILD.bazel +++ b/pw_bluetooth_sapphire/host/gap/BUILD.bazel @@ -193,6 +193,11 @@ pw_cc_test( "secure_simple_pairing_state_test.cc", "types_test.cc", ], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = [ + "noasan", + "noubsan", + ], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":gap", diff --git a/pw_bluetooth_sapphire/host/gatt/BUILD.bazel b/pw_bluetooth_sapphire/host/gatt/BUILD.bazel index 7e7a9da24..8a8ea39ce 100644 --- a/pw_bluetooth_sapphire/host/gatt/BUILD.bazel +++ b/pw_bluetooth_sapphire/host/gatt/BUILD.bazel @@ -124,6 +124,8 @@ pw_cc_test( "remote_service_manager_test.cc", "server_test.cc", ], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":gatt", diff --git a/pw_bluetooth_sapphire/host/hci/BUILD.bazel b/pw_bluetooth_sapphire/host/hci/BUILD.bazel index d284c451d..a212ce7a9 100644 --- a/pw_bluetooth_sapphire/host/hci/BUILD.bazel +++ b/pw_bluetooth_sapphire/host/hci/BUILD.bazel @@ -113,6 +113,8 @@ pw_cc_test( "low_energy_scanner_test.cc", "sequential_command_runner_test.cc", ], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":hci", diff --git a/pw_bluetooth_sapphire/host/iso/BUILD.bazel b/pw_bluetooth_sapphire/host/iso/BUILD.bazel index 2dc844547..1cc47c2ba 100644 --- a/pw_bluetooth_sapphire/host/iso/BUILD.bazel +++ b/pw_bluetooth_sapphire/host/iso/BUILD.bazel @@ -70,6 +70,11 @@ pw_cc_test( "iso_stream_manager_test.cc", "iso_stream_test.cc", ], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = [ + "noasan", + "notsan", + ], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":iso", diff --git a/pw_bluetooth_sapphire/host/l2cap/BUILD.bazel b/pw_bluetooth_sapphire/host/l2cap/BUILD.bazel index 71b8c9f31..0c7ec78aa 100644 --- a/pw_bluetooth_sapphire/host/l2cap/BUILD.bazel +++ b/pw_bluetooth_sapphire/host/l2cap/BUILD.bazel @@ -258,6 +258,8 @@ pw_cc_fuzz_test( pw_cc_fuzz_test( name = "channel_configuration_fuzzer", srcs = ["channel_configuration_fuzztest.cc"], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], deps = [ ":l2cap", ":testing", @@ -267,6 +269,8 @@ pw_cc_fuzz_test( pw_cc_fuzz_test( name = "common_handler_fuzzer", srcs = ["common_handler_fuzztest.cc"], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], deps = [ ":l2cap", ":testing", diff --git a/pw_bluetooth_sapphire/host/sm/BUILD.bazel b/pw_bluetooth_sapphire/host/sm/BUILD.bazel index a697fe93f..23b66cc4a 100644 --- a/pw_bluetooth_sapphire/host/sm/BUILD.bazel +++ b/pw_bluetooth_sapphire/host/sm/BUILD.bazel @@ -137,6 +137,8 @@ pw_cc_test( "types_test.cc", "util_test.cc", ], + # TODO: https://pwbug.dev/393957973 - Fix this test. + tags = ["noubsan"], test_main = "//pw_bluetooth_sapphire/host/testing:gtest_main", deps = [ ":sm",