diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2018-08-30 10:13:23 -0400 |
---|---|---|
committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-10-24 16:49:34 -0400 |
commit | 5d1c6580d616dfc864ffdec587e645e50a21c072 (patch) | |
tree | cee9a9914f00a0b2bbded8b012b0dd89012f9c86 /tools/testing | |
parent | 9d954f9519707bc0af29ead8b1dedc660306da1b (diff) |
selftests/ftrace: Add --console hidden option
Add --console hidden option for debug test cases.
This option allows to put "sh" or something else
when the test case hits a bug.
For example, if you find a testcase which doesn't
pass, you can insert sh for interactive debug as below
-----
#!/bin/sh
# description: sample test case
good-command
suspicious-wrong-command
sh # <- add this for interactive debug
-----
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-x | tools/testing/selftests/ftrace/ftracetest | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest index c9c7fa8dc440..8debd37038e4 100755 --- a/tools/testing/selftests/ftrace/ftracetest +++ b/tools/testing/selftests/ftrace/ftracetest | |||
@@ -60,11 +60,21 @@ parse_opts() { # opts | |||
60 | shift 1 | 60 | shift 1 |
61 | ;; | 61 | ;; |
62 | --verbose|-v|-vv|-vvv) | 62 | --verbose|-v|-vv|-vvv) |
63 | if [ $VERBOSE -eq -1 ]; then | ||
64 | usage "--console can not use with --verbose" | ||
65 | fi | ||
63 | VERBOSE=$((VERBOSE + 1)) | 66 | VERBOSE=$((VERBOSE + 1)) |
64 | [ $1 = '-vv' ] && VERBOSE=$((VERBOSE + 1)) | 67 | [ $1 = '-vv' ] && VERBOSE=$((VERBOSE + 1)) |
65 | [ $1 = '-vvv' ] && VERBOSE=$((VERBOSE + 2)) | 68 | [ $1 = '-vvv' ] && VERBOSE=$((VERBOSE + 2)) |
66 | shift 1 | 69 | shift 1 |
67 | ;; | 70 | ;; |
71 | --console) | ||
72 | if [ $VERBOSE -ne 0 ]; then | ||
73 | usage "--console can not use with --verbose" | ||
74 | fi | ||
75 | VERBOSE=-1 | ||
76 | shift 1 | ||
77 | ;; | ||
68 | --debug|-d) | 78 | --debug|-d) |
69 | DEBUG=1 | 79 | DEBUG=1 |
70 | shift 1 | 80 | shift 1 |
@@ -283,7 +293,9 @@ run_test() { # testfile | |||
283 | testcase $1 | 293 | testcase $1 |
284 | echo "execute$INSTANCE: "$1 > $testlog | 294 | echo "execute$INSTANCE: "$1 > $testlog |
285 | SIG_RESULT=0 | 295 | SIG_RESULT=0 |
286 | if [ -z "$LOG_FILE" ]; then | 296 | if [ $VERBOSE -eq -1 ]; then |
297 | __run_test $1 | ||
298 | elif [ -z "$LOG_FILE" ]; then | ||
287 | __run_test $1 2>&1 | 299 | __run_test $1 2>&1 |
288 | elif [ $VERBOSE -ge 3 ]; then | 300 | elif [ $VERBOSE -ge 3 ]; then |
289 | __run_test $1 | tee -a $testlog 2>&1 | 301 | __run_test $1 | tee -a $testlog 2>&1 |