commit | 2b9f1ae9aed225b81ee6864d8c65df00d9c8cd15 | [log] [tgz] |
---|---|---|
author | Florian Mayer <fmayer@google.com> | Sat Apr 16 07:53:31 2022 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Apr 16 07:53:31 2022 +0000 |
tree | 964e0b405d5de898143570cf030385509bb633d6 | |
parent | 2def188bc22bf46beaf2bd1387beb3f5e438560a [diff] | |
parent | fff80ceee21221ee781b7eb970e8efed4ae34b28 [diff] |
Add SKIP_WITH_HWASAN macro. am: 1055a295b0 am: f052050c10 am: 75d66dd7de am: fff80ceee2 Original change: https://android-review.googlesource.com/c/platform/system/libbase/+/2064640 Change-Id: I514a8935e7078cd3204d6596d4ef228f24e41af6 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()