commit | fff80ceee21221ee781b7eb970e8efed4ae34b28 | [log] [tgz] |
---|---|---|
author | Florian Mayer <fmayer@google.com> | Sat Apr 16 07:32:41 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Apr 16 07:32:41 2022 +0000 |
tree | 964e0b405d5de898143570cf030385509bb633d6 | |
parent | 8dc18fd8fe67d6d60d7f8946a98b4511640b1413 [diff] | |
parent | 75d66dd7de4f9e4de43c2c3f9edc1fa6c6d53895 [diff] |
Add SKIP_WITH_HWASAN macro. am: 1055a295b0 am: f052050c10 am: 75d66dd7de Original change: https://android-review.googlesource.com/c/platform/system/libbase/+/2064640 Change-Id: I5dabb3da71a41eaa8279464c97724b6ea2467005 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/include/android-base/test_utils.h b/include/android-base/test_utils.h index 4086b83..29dc394 100644 --- a/include/android-base/test_utils.h +++ b/include/android-base/test_utils.h
@@ -88,3 +88,10 @@ ADD_FAILURE() << "regex mismatch: expected to not find " << (__pattern) << " in:\n" << __s; \ } \ } while (0) + +extern "C" void __hwasan_init() __attribute__((weak)); +static inline bool running_with_hwasan() { + return &__hwasan_init != 0; +} + +#define SKIP_WITH_HWASAN if (running_with_hwasan()) GTEST_SKIP()