BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros am: 5460527c74 am: 4273296e72 am: 959ccaba1d am: f9704b7868

Original change: https://android-review.googlesource.com/c/platform/system/bpf/+/1888239

Change-Id: I1203298688941642ed2e4bd9c79b5b8b4785f168
This commit is contained in:
Maciej Żenczykowski 2021-11-12 10:07:26 +00:00 committed by Automerger Merge Worker
commit de273ee1b7

View file

@ -45,38 +45,28 @@ static inline bool isAtLeastKernelVersion(unsigned major, unsigned minor, unsign
return kernelVersion() >= KVER(major, minor, sub);
}
#define SKIP_IF_BPF_SUPPORTED \
do { \
if (android::bpf::isAtLeastKernelVersion(4, 9, 0)) { \
GTEST_LOG_(INFO) << "This test is skipped since bpf is supported\n"; \
return; \
} \
#define SKIP_IF_BPF_SUPPORTED \
do { \
if (android::bpf::isAtLeastKernelVersion(4, 9, 0)) \
GTEST_SKIP() << "Skip: bpf is supported."; \
} while (0)
#define SKIP_IF_BPF_NOT_SUPPORTED \
do { \
if (!android::bpf::isAtLeastKernelVersion(4, 9, 0)) { \
GTEST_LOG_(INFO) << "This test is skipped since bpf is not supported\n"; \
return; \
} \
#define SKIP_IF_BPF_NOT_SUPPORTED \
do { \
if (!android::bpf::isAtLeastKernelVersion(4, 9, 0)) \
GTEST_SKIP() << "Skip: bpf is not supported."; \
} while (0)
#define SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED \
do { \
if (!android::bpf::isAtLeastKernelVersion(4, 14, 0)) { \
GTEST_LOG_(INFO) << "This test is skipped since extended bpf feature" \
<< "not supported\n"; \
return; \
} \
#define SKIP_IF_EXTENDED_BPF_NOT_SUPPORTED \
do { \
if (!android::bpf::isAtLeastKernelVersion(4, 14, 0)) \
GTEST_SKIP() << "Skip: extended bpf feature not supported."; \
} while (0)
#define SKIP_IF_XDP_NOT_SUPPORTED \
do { \
if (!android::bpf::isAtLeastKernelVersion(5, 9, 0)) { \
GTEST_LOG_(INFO) << "This test is skipped since xdp" \
<< "not supported\n"; \
return; \
} \
#define SKIP_IF_XDP_NOT_SUPPORTED \
do { \
if (!android::bpf::isAtLeastKernelVersion(5, 9, 0)) \
GTEST_SKIP() << "Skip: xdp not supported."; \
} while (0)
} // namespace bpf