aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2018-10-31 11:38:21 -0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-11-25 17:11:22 +1100
commite653b6567e9c1854f51fb649c676499498560977 (patch)
tree1c9be40bf8ecf8410a807714bf3154ae3c8d210a /tools/testing/selftests
parentselftests/powerpc: Allocate base registers (diff)
downloadlinux-dev-e653b6567e9c1854f51fb649c676499498560977.tar.xz
linux-dev-e653b6567e9c1854f51fb649c676499498560977.zip
selftests/powerpc: Create a new SKIP_IF macro
This patch creates a new macro that skips a test and prints a message to stderr. This is useful to give an idea why the tests is being skipped, other than just skipping the test blindly. Signed-off-by: Breno Leitao <leitao@debian.org> Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/powerpc/include/utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/include/utils.h b/tools/testing/selftests/powerpc/include/utils.h
index 49621822d7c3..ae43a614835d 100644
--- a/tools/testing/selftests/powerpc/include/utils.h
+++ b/tools/testing/selftests/powerpc/include/utils.h
@@ -82,6 +82,16 @@ do { \
} \
} while (0)
+#define SKIP_IF_MSG(x, msg) \
+do { \
+ if ((x)) { \
+ fprintf(stderr, \
+ "[SKIP] Test skipped on line %d: %s\n", \
+ __LINE__, msg); \
+ return MAGIC_SKIP_RETURN_VALUE; \
+ } \
+} while (0)
+
#define _str(s) #s
#define str(s) _str(s)