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>
This commit is contained in:

committed by
Michael Ellerman

parent
5249497a7b
commit
e653b6567e
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user