Commit 33b4819f authored by Michael Ellerman's avatar Michael Ellerman Committed by Benjamin Herrenschmidt

selftests/powerpc: Add support for skipping tests

Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent de506f73
...@@ -105,6 +105,9 @@ int test_harness(int (test_function)(void), char *name) ...@@ -105,6 +105,9 @@ int test_harness(int (test_function)(void), char *name)
rc = run_test(test_function, name); rc = run_test(test_function, name);
if (rc == MAGIC_SKIP_RETURN_VALUE)
test_skip(name);
else
test_finish(name, rc); test_finish(name, rc);
return rc; return rc;
......
...@@ -26,6 +26,11 @@ static inline void test_error(char *name) ...@@ -26,6 +26,11 @@ static inline void test_error(char *name)
printf("error: %s\n", name); printf("error: %s\n", name);
} }
static inline void test_skip(char *name)
{
printf("skip: %s\n", name);
}
static inline void test_success(char *name) static inline void test_success(char *name)
{ {
printf("success: %s\n", name); printf("success: %s\n", name);
......
...@@ -31,6 +31,18 @@ do { \ ...@@ -31,6 +31,18 @@ do { \
} \ } \
} while (0) } while (0)
/* The test harness uses this, yes it's gross */
#define MAGIC_SKIP_RETURN_VALUE 99
#define SKIP_IF(x) \
do { \
if ((x)) { \
fprintf(stderr, \
"[SKIP] Test skipped on line %d\n", __LINE__); \
return MAGIC_SKIP_RETURN_VALUE; \
} \
} while (0)
#define _str(s) #s #define _str(s) #s
#define str(s) _str(s) #define str(s) _str(s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment