diff options
author | Breno Leitao <leitao@debian.org> | 2018-10-31 17:38:21 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-11-25 09:11:22 +0300 |
commit | e653b6567e9c1854f51fb649c676499498560977 (patch) | |
tree | 1c9be40bf8ecf8410a807714bf3154ae3c8d210a | |
parent | 5249497a7bb6334fcc128588d6a7e1e21786515a (diff) | |
download | linux-e653b6567e9c1854f51fb649c676499498560977.tar.xz |
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>
-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) |