diff options
author | Breno Leitao <leitao@debian.org> | 2018-10-31 11:38:21 -0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-11-25 17:11:22 +1100 |
commit | e653b6567e9c1854f51fb649c676499498560977 (patch) | |
tree | 1c9be40bf8ecf8410a807714bf3154ae3c8d210a /tools/testing/selftests/powerpc | |
parent | 5249497a7bb6334fcc128588d6a7e1e21786515a (diff) |
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/powerpc')
-rw-r--r-- | tools/testing/selftests/powerpc/include/utils.h | 10 |
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) |