summaryrefslogtreecommitdiff
path: root/libbpf_android
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2021-09-17 15:27:42 -0700
committerMaciej Żenczykowski <maze@google.com>2021-11-11 11:54:02 -0800
commit5460527c74262b77a7d38732f0fce34efd24dd68 (patch)
tree453c7594a9a95c3416fc057869e366267de8a5bc /libbpf_android
parentfa03239a811490fdd479fecf35bfad7f0adba406 (diff)
downloadbpf-5460527c74262b77a7d38732f0fce34efd24dd68.tar.gz
BpfUtils.h - switch to GTEST_SKIP in all 4 SKIP macros
Test: TreeHugger, atest libbpf_android_test netd_unit_test netd_integration_test Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I3acb47a432378f257418f81b26516e18d6ff3780
Diffstat (limited to 'libbpf_android')
-rw-r--r--libbpf_android/include/bpf/BpfUtils.h42
1 files changed, 16 insertions, 26 deletions
diff --git a/libbpf_android/include/bpf/BpfUtils.h b/libbpf_android/include/bpf/BpfUtils.h
index 8fd2a4a..f0d73e0 100644
--- a/libbpf_android/include/bpf/BpfUtils.h
+++ b/libbpf_android/include/bpf/BpfUtils.h
@@ -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