aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 10:12:55 -0400
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 16:49:34 -0400
commit9d954f9519707bc0af29ead8b1dedc660306da1b (patch)
tree679c28ff07256e22b0b49a2d4189af460a5540dd /tools/testing
parent84df9525b0c27f3ebc2ebb1864fa62a97fdedb7d (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-xtools/testing/selftests/ftrace/ftracetest13
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
117DEBUG=0 121DEBUG=0
118VERBOSE=0 122VERBOSE=0
119UNSUPPORTED_RESULT=0 123UNSUPPORTED_RESULT=0
124STOP_FAILURE=0
120# Parse command-line options 125# Parse command-line options
121parse_opts $* 126parse_opts $*
122 127
@@ -304,6 +309,10 @@ run_test() { # testfile
304# Main loop 309# Main loop
305for t in $TEST_CASES; do 310for 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
307done 316done
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
318done 331done
319 332
320prlog "" 333prlog ""