Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/powerpc: Add support for skipping tests

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Michael Ellerman and committed by
Benjamin Herrenschmidt
33b4819f de506f73

+21 -1
+4 -1
tools/testing/selftests/powerpc/harness.c
··· 105 105 106 106 rc = run_test(test_function, name); 107 107 108 - test_finish(name, rc); 108 + if (rc == MAGIC_SKIP_RETURN_VALUE) 109 + test_skip(name); 110 + else 111 + test_finish(name, rc); 109 112 110 113 return rc; 111 114 }
+5
tools/testing/selftests/powerpc/subunit.h
··· 26 26 printf("error: %s\n", name); 27 27 } 28 28 29 + static inline void test_skip(char *name) 30 + { 31 + printf("skip: %s\n", name); 32 + } 33 + 29 34 static inline void test_success(char *name) 30 35 { 31 36 printf("success: %s\n", name);
+12
tools/testing/selftests/powerpc/utils.h
··· 31 31 } \ 32 32 } while (0) 33 33 34 + /* The test harness uses this, yes it's gross */ 35 + #define MAGIC_SKIP_RETURN_VALUE 99 36 + 37 + #define SKIP_IF(x) \ 38 + do { \ 39 + if ((x)) { \ 40 + fprintf(stderr, \ 41 + "[SKIP] Test skipped on line %d\n", __LINE__); \ 42 + return MAGIC_SKIP_RETURN_VALUE; \ 43 + } \ 44 + } while (0) 45 + 34 46 #define _str(s) #s 35 47 #define str(s) _str(s) 36 48