diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2018-08-30 10:12:55 -0400 |
---|---|---|
committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-10-24 16:49:34 -0400 |
commit | 9d954f9519707bc0af29ead8b1dedc660306da1b (patch) | |
tree | 679c28ff07256e22b0b49a2d4189af460a5540dd /tools/testing | |
parent | 84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d (diff) |
selftests/ftrace: Add --stop-fail hidden option for debug
Add --stop-fail option for debugging the ftracetest.
With this option, ftracetest stops right after a testcase
fails instead of finish running all testcases.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-x | tools/testing/selftests/ftrace/ftracetest | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest index f9a9d424c980..c9c7fa8dc440 100755 --- a/tools/testing/selftests/ftrace/ftracetest +++ b/tools/testing/selftests/ftrace/ftracetest | |||
@@ -69,6 +69,10 @@ parse_opts() { # opts | |||
69 | DEBUG=1 | 69 | DEBUG=1 |
70 | shift 1 | 70 | shift 1 |
71 | ;; | 71 | ;; |
72 | --stop-fail) | ||
73 | STOP_FAILURE=1 | ||
74 | shift 1 | ||
75 | ;; | ||
72 | --fail-unsupported) | 76 | --fail-unsupported) |
73 | UNSUPPORTED_RESULT=1 | 77 | UNSUPPORTED_RESULT=1 |
74 | shift 1 | 78 | shift 1 |
@@ -117,6 +121,7 @@ KEEP_LOG=0 | |||
117 | DEBUG=0 | 121 | DEBUG=0 |
118 | VERBOSE=0 | 122 | VERBOSE=0 |
119 | UNSUPPORTED_RESULT=0 | 123 | UNSUPPORTED_RESULT=0 |
124 | STOP_FAILURE=0 | ||
120 | # Parse command-line options | 125 | # Parse command-line options |
121 | parse_opts $* | 126 | parse_opts $* |
122 | 127 | ||
@@ -304,6 +309,10 @@ run_test() { # testfile | |||
304 | # Main loop | 309 | # Main loop |
305 | for t in $TEST_CASES; do | 310 | for t in $TEST_CASES; do |
306 | run_test $t | 311 | run_test $t |
312 | if [ $STOP_FAILURE -ne 0 -a $TOTAL_RESULT -ne 0 ]; then | ||
313 | echo "A failure detected. Stop test." | ||
314 | exit 1 | ||
315 | fi | ||
307 | done | 316 | done |
308 | 317 | ||
309 | # Test on instance loop | 318 | # Test on instance loop |
@@ -315,6 +324,10 @@ for t in $TEST_CASES; do | |||
315 | run_test $t | 324 | run_test $t |
316 | rmdir $TRACING_DIR | 325 | rmdir $TRACING_DIR |
317 | TRACING_DIR=$SAVED_TRACING_DIR | 326 | TRACING_DIR=$SAVED_TRACING_DIR |
327 | if [ $STOP_FAILURE -ne 0 -a $TOTAL_RESULT -ne 0 ]; then | ||
328 | echo "A failure detected. Stop test." | ||
329 | exit 1 | ||
330 | fi | ||
318 | done | 331 | done |
319 | 332 | ||
320 | prlog "" | 333 | prlog "" |