Skip to content

Commit 3c6a95e

Browse files
fabio-dAlexisPerry
authored andcommitted
[scudo] Add TEST_SKIP macro to skip the current test (llvm#96192)
1 parent f45da5d commit 3c6a95e

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

compiler-rt/lib/scudo/standalone/tests/memtag_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace scudo {
1919

2020
TEST(MemtagBasicDeathTest, Unsupported) {
2121
if (archSupportsMemoryTagging())
22-
GTEST_SKIP();
22+
TEST_SKIP("Memory tagging is not supported");
2323
// Skip when running with HWASan.
2424
if (&__hwasan_init != 0)
25-
GTEST_SKIP();
25+
TEST_SKIP("Incompatible with HWASan");
2626

2727
EXPECT_DEATH(archMemoryTagGranuleSize(), "not supported");
2828
EXPECT_DEATH(untagPointer((uptr)0), "not supported");
@@ -48,7 +48,7 @@ class MemtagTest : public Test {
4848
protected:
4949
void SetUp() override {
5050
if (!archSupportsMemoryTagging() || !systemDetectsMemoryTagFaultsTestOnly())
51-
GTEST_SKIP() << "Memory tagging is not supported";
51+
TEST_SKIP("Memory tagging is not supported");
5252

5353
BufferSize = getPageSizeCached();
5454
ASSERT_FALSE(MemMap.isAllocated());

compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@
1111
#if SCUDO_FUCHSIA
1212
#include <zxtest/zxtest.h>
1313
using Test = ::zxtest::Test;
14+
#define TEST_SKIP(message) ZXTEST_SKIP(message)
1415
#else
1516
#include "gtest/gtest.h"
1617
using Test = ::testing::Test;
18+
#define TEST_SKIP(message) \
19+
do { \
20+
GTEST_SKIP() << message; \
21+
} while (0)
1722
#endif
1823

1924
// If EXPECT_DEATH isn't defined, make it a no-op.

compiler-rt/lib/scudo/standalone/tests/strings_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ TEST(ScudoStringsTest, CapacityIncreaseFails) {
147147
MAP_ALLOWNOMEM)) {
148148
MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
149149
setrlimit(RLIMIT_AS, &Limit);
150-
GTEST_SKIP() << "Limiting address space does not prevent mmap.";
150+
TEST_SKIP("Limiting address space does not prevent mmap.");
151151
}
152152

153153
// Test requires that the default length is at least 6 characters.

compiler-rt/lib/scudo/standalone/tests/vector_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ TEST(ScudoVectorTest, ReallocateFails) {
6464
MAP_ALLOWNOMEM)) {
6565
MemMap.unmap(MemMap.getBase(), MemMap.getCapacity());
6666
setrlimit(RLIMIT_AS, &Limit);
67-
GTEST_SKIP() << "Limiting address space does not prevent mmap.";
67+
TEST_SKIP("Limiting address space does not prevent mmap.");
6868
}
6969

7070
V.resize(capacity);

0 commit comments

Comments
 (0)