Disable die_on_malloc tests on asan/msan
They use instrumented mallocs, so they don't work here. Skip just the
tests in question, since the rest add value.
Change-Id: Iaa9c546db72004ea1c65cc98c46a0c391465bd19
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/realtime_test.cc b/aos/realtime_test.cc
index 98f53e1..021b25b 100644
--- a/aos/realtime_test.cc
+++ b/aos/realtime_test.cc
@@ -77,6 +77,9 @@
CheckNotRealtime();
}
+// Malloc hooks don't work with asan/msan.
+#if !__has_feature(address_sanitizer) && !__has_feature(memory_sanitizer)
+
// Tests that CHECK statements give real error messages rather than die on
// malloc.
TEST(RealtimeDeathTest, Check) {
@@ -127,6 +130,8 @@
"Cute message here");
}
+#endif
+
} // namespace testing
} // namespace aos
@@ -135,7 +140,10 @@
GTEST_API_ int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
FLAGS_logtostderr = true;
+
+#if !__has_feature(address_sanitizer) && !__has_feature(memory_sanitizer)
FLAGS_die_on_malloc = true;
+#endif
aos::InitGoogle(&argc, &argv);