kselftest: make ksft_exit_skip() output a reason for skipping
authorPaul Elder <paul.elder@pitt.edu>
Thu, 15 Jun 2017 15:54:20 +0000 (00:54 +0900)
committerShuah Khan <shuahkh@osg.samsung.com>
Fri, 16 Jun 2017 00:07:45 +0000 (18:07 -0600)
Make ksft_exit_skip() input an optional message string as the reason
for skipping all the tests and outputs it prior to exiting.

Signed-off-by: Paul Elder <paul.elder@pitt.edu>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/kselftest.h

index 1d874a50d957e70186897550ae70c7cc4867e937..be01f2d154721e2df84cbec848c42d3e04a50d94 100644 (file)
@@ -104,9 +104,12 @@ static inline int ksft_exit_xpass(void)
        exit(KSFT_XPASS);
 }
 
-static inline int ksft_exit_skip(void)
+static inline int ksft_exit_skip(const char *msg)
 {
-       ksft_print_cnts();
+       if (msg)
+               printf("1..%d # Skipped: %s\n", ksft_test_num(), msg);
+       else
+               ksft_print_cnts();
        exit(KSFT_SKIP);
 }