[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <06b5821fe10e973b90adb386e089721d99b651b5.1509749022.git.shuahkh@osg.samsung.com>
Date: Fri, 3 Nov 2017 16:51:50 -0600
From: Shuah Khan <shuahkh@....samsung.com>
To: shuah@...nel.org
Cc: Shuah Khan <shuahkh@....samsung.com>,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] selftests: kselftest framework: add handling for TAP header level
Introduce environment variable KSFT_TAP_LEVEL to avoid printing
nested TAP headers for each test. lib.mk run_tests target prints
TAP header before invoking the test program or test script. Tests
need a way to suppress TAP headers if it is already printed out.
This new environment variable adds a way for ksft_print_header()
print TAP header only when KSFT_TAP_LEVEL isn't set.
lib.mk run_tests and test program should print TAP header and set
KSFT_TAP_LEVEL to avoid a second TAP header to be printed.
Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
---
tools/testing/selftests/kselftest.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index 1ae565ed9bf0..d6732ba312ef 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -57,7 +57,8 @@ static inline int ksft_get_error_cnt(void) { return ksft_cnt.ksft_error; }
static inline void ksft_print_header(void)
{
- printf("TAP version 13\n");
+ if (!(getenv("KSFT_TAP_LEVEL"))
+ printf("TAP version 13\n");
}
static inline void ksft_print_cnts(void)
--
2.11.0
Powered by blists - more mailing lists